Changes between Version 16 and Version 17 of DeveloperGuidelinesS3Framework


Ignore:
Timestamp:
04/17/09 12:44:50 (16 years ago)
Author:
Fran Boon
Comment:

db.Field instead of SQLField for better GAE compatibility

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesS3Framework

    v16 v17  
    4444# Reusable timestamp fields
    4545timestamp=SQLTable(None,'timestamp',
    46             SQLField('created_on','datetime',
     46            db.Field('created_on','datetime',
    4747                          writable=False,
    4848                          default=request.now),
    49             SQLField('modified_on','datetime',
     49            db.Field('modified_on','datetime',
    5050                          writable=False,
    5151                          default=request.now,update=request.now))
     
    5454import uuid
    5555uuidstamp=SQLTable(None,'uuidstamp',
    56             SQLField('uuid',length=64,
     56            db.Field('uuid',length=64,
    5757                          writable=False,
    5858                          default=uuid.uuid4()))
     
    7878
    7979Form field can be made to use a TEXTAREA by marking the field as being type 'text':
    80    {{{SQLField('field','text'),}}}
     80   {{{db.Field('field','text'),}}}
    8181
    8282Form field can be made to use a SELECT dropdown by setting the field as a lookup to another table...linked to the 'id' field to allow [wiki:DeveloperGuidelinesDatabaseSynchronization Database Synchronization], but displaying a more user-friendly field (such as 'name'):
    8383{{{
    84 SQLField('field',db.othertable),
     84db.Field('field',db.othertable),
    8585
    8686db.table.field.requires=IS_NULL_OR(IS_IN_DB(db,'othertable.id','othertable.name'))