Changes between Version 16 and Version 17 of DeveloperGuidelinesS3Framework
- Timestamp:
- 04/17/09 12:44:50 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelinesS3Framework
v16 v17 44 44 # Reusable timestamp fields 45 45 timestamp=SQLTable(None,'timestamp', 46 SQLField('created_on','datetime',46 db.Field('created_on','datetime', 47 47 writable=False, 48 48 default=request.now), 49 SQLField('modified_on','datetime',49 db.Field('modified_on','datetime', 50 50 writable=False, 51 51 default=request.now,update=request.now)) … … 54 54 import uuid 55 55 uuidstamp=SQLTable(None,'uuidstamp', 56 SQLField('uuid',length=64,56 db.Field('uuid',length=64, 57 57 writable=False, 58 58 default=uuid.uuid4())) … … 78 78 79 79 Form 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'),}}} 81 81 82 82 Form 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'): 83 83 {{{ 84 SQLField('field',db.othertable),84 db.Field('field',db.othertable), 85 85 86 86 db.table.field.requires=IS_NULL_OR(IS_IN_DB(db,'othertable.id','othertable.name'))