I think it's probably because of this:

db.define_table('us_states',
    SQLField( 'state', 'string',length=2),
    SQLField( 'name', 'string',length=20))

db.define_table('us_data',
    SQLField( 'area_code', 'string', length=3),
    SQLField( 'city', 'text', length=25),
    SQLField( 'state', 'text', length=2),

I'm going to try setting type for us_data.state to string ...

Yup, I'm betting that's it.

I'm trying to use type 'text' where I'm not expecting to ever search
to cut down on the automatic indexing that GAE does.  Seems like doing
that requires balancing the problems with type mismatches.

Sorry for the false alarm and thanks for the quick responses.

PS: I'm using a two-character state abbreviation pull-down on a form
where AK does come before AL.   But yes, it would be nice to use the
full names.

On Mar 5, 11:00 am, mdipierro <[email protected]> wrote:
> we need more details.
>
> On Mar 5, 11:18 am, Jim <[email protected]> wrote:
>
> > I want to bulk upload some data.
>
> > What I've noticed in testing is that I had something like this:
>
> > info=whatever,state=NJ,moreinfo=something
>
> > I decided I better make sure the state is in standard format so I
> > added
>
> > db.data.state.requires=IS_IN_DB(db,db.us_states.state)
>
> > If I edit that record via the admin tool or via my program, the pull-
> > down is set to AK.
>
> > If I set it properly and save it, it's fine the next time.  Meaning
> > that it's set to NJ, not AK.
>
> > I'm not sure what's happening.  I'm a little worried about people
> > editing information and not noticing that they're setting the state
> > incorrectly.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to