The problem is that
Field('death_date', 'date', label='Date of death',
required=False, default='', requires=IS_NULL_OR(IS_DATE(),
comment='optional ex: 1975-09-20'),
should be
Field('death_date', 'date', label='Date of death',
required=False, default='', requires=IS_NULL_OR(IS_DATE
()),
comment='optional ex: 1975-09-20'),
On Sep 6, 12:21 pm, jayvandal <[email protected]> wrote:
> Hi,
> I had my database application up and running. I was editing some date
> fields. edited one field an athen I used the ctrl and letter C to copy
> some dat and used Ctrl letter V to place the changed data. I use this
> method to adjust the other date fields. Then I went out and tried to
> run the adminstration for the database and get and error tha indicates
> tha I have an error in the fields that points back to a field
> definition as
> "db.person.first_name requires IS_NOT_EMPTY()"
>
> If I delete that line, it points to the next line as an error.
> I have copied the definiting out to Crimson Editor and mad mass
> changes chandgin field definitions form SQLField to Field( indicated
> in your manual 2nd ed) but its not that?
>
> Is there a way I can find the undisplayed character or use a better
> editor?
> or what?
> Thanks for any help
> Jim
>
> code is a follows
> ======================================================
> db.define_table('specialty',Field('name'))
> from gluon.tools import *
> auth=Auth(globals(),db) # authentication/authorization
> # the fields below are requires you can add more
> db.define_table('person',
> Field('first_name', length=128),
> Field('middle_name', length=128,default=''),
> Field('last_name', length=128,default=''),
> Field('birth_date','date',default=now),
> Field('death_date', 'date', label='Date of death',
> required=False, default='', requires=IS_NULL_OR(IS_DATE(),
> comment='optional ex: 1975-09-20'),
>
> Field('email', length=128,default=''),
> Field('web_page', length=128),
> Field('is_politician', 'boolean', default=True),
> Field('is_business', 'boolean', default=True),
> Field('is_education', 'boolean', default=True),
> Field('is_government', 'boolean', default=True),
> Field('is_military', 'boolean', default=True),
> Field('password', 'password',readable=False,label='Password'),
> Field('registration_key', length=128,
> writable=False, readable=False, default=''))
>
> db.person.first_name.requires = [IS_NOT_EMPTY()]
> db.person.last_name.requires = [IS_NOT_EMPTY()]
> db.person.password.requires = [CRYPT()] # password will be stored
> hashed
> db.person.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db,
> db.auth_user.email)]
> #t.death_date.requires=IS_NULL_OR(IS_DATE()
> #t.web_page.requires=IS_URL()
> #auth.define_tables() ### auth_user will not be redefined!
>
> db.define_table('states',
> Field('state_name',length=128),
> Field('abbreviation',length=2))
> db.define_table('category',
> Field('category_name',length=128),
> Field('abbreviation',length=5))
>
> db.define_table('education',
> Field('person',db.person),
> Field('school_name',length = 50),
> Field('start_date','date',default=now),
> # Field('end_date','date',default=date(YYYY,MM,DD) ),
> Field('end_date', 'date', label='Date of death',
> required=False, default='', requires=IS_NULL_OR(IS_DATE(),
> comment='optional ex: 1975-09-20'),
> Field('address',length=128),
> Field('city',length=128),
> Field('states',db.states),
> Field('country',length=128))
>
> db.education.person.requires=IS_IN_DB
> (db,'person.id','person.last_name')
> db.education.states.requires=IS_IN_DB
> (db,'states.id','states.state_name')
> db.define_table('work',
> Field('person',db.person),
> Field('supervisor',db.person),
> Field('start_date','date',default=now),
> Field('end_date','date'),
> required=False, default='', requires=IS_NULL_OR(IS_DATE(),
> comment='optional ex: 1975-09-20'),
>
> Field('amount','integer'),
> Field('address',length=128),
> Field('city',length=128),
> Field('states',db.states),
> Field('country',length=128))
> db.work.person.requires=IS_IN_DB(db,'person.id','person.last_name')
> db.work.states.requires=IS_IN_DB
> (db,'states.id','states.state_name')
>
> db.define_table('housing',
> Field('person',db.person),
> Field('start_date','date',default=now),
> Field('end_date','date'),
> required=False, default='', requires=IS_NULL_OR(IS_DATE(),
> comment='optional ex: 1975-09-20'),
>
> Field('address',length=128),
> Field('city',length=128),
> Field('states',db.states),
> Field('country',length=128),
> Field('amount','integer'))
> db.housing.person.requires=IS_IN_DB(db,'person.id','person.last_name')
> db.housing.states.requires=IS_IN_DB
> (db,'states.id','states.state_name')
>
> db.define_table('associations',
> Field('person',db.person),
> Field('contact',db.person),
> Field('start_date','date',default=now),
> Field('end_date','date'),
> required=False, default='', requires=IS_NULL_OR(IS_DATE(),
> comment='optional ex: 1975-09-20'),
> Field('address',length=128),
> Field('city',length=128),
> Field('states',db.states),
> Field('country',length=128),
> Field('amount','integer'))
> db.associations.person.requires=IS_IN_DB
> (db,'person.id','person.last_name')
> db.associations.states.requires=IS_IN_DB
> (db,'states.id','states.state_name')
>
> db.define_table('events',
> Field('person',db.person),
> Field('description',length=128),
> Field('category',db.category),
> Field('contact',db.person),
> Field('start_date','date',default=now),
> Field('end_date','date'),
> required=False, default='', requires=IS_NULL_OR(IS_DATE(),
> comment='optional ex: 1975-09-20'),
> Field('address',length=128),
> Field('city',length=128),
> Field('states',db.states),
> Field('country',length=128),
> Field('zipcode',length=9),
> Field('amount','integer'))
> db.events.person.requires=IS_IN_DB(db,'person.id','person.last_name')
> db.events.states.requires=IS_IN_DB(db,'states.id','states.state_name')
> db.events.category.requires=IS_IN_DB
> (db,'category.id','category.category_name')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---