I just point out the doc I think could help you... I have not work with
multiple PK and FK.

There is also UUID, but not sure it serve for your needs

Richard

On Thu, Nov 25, 2010 at 9:51 AM, Johann Spies <[email protected]>wrote:

> Hallo Richard,
>
>
> On 25 November 2010 16:26, Richard Vézina <[email protected]>wrote:
>
>> I think it cover in as keyed table in the book
>>
>> I  am not sure how that will solve my problem.
>
> It creates new problems:
>
>
> signature = db.Table(db, 'signature',
>                      Field('created_on', 'datetime', default=request.now,
>                            readable = False, writable = False),
>                      Field('created_by', db.auth_user,
> default=auth.user_id,
>                            readable = False, writable = False),
>                      Field('updated_on', 'datetime', default=request.now,
>                            readable = False, writable = False),
>                      Field('updated_by', db.auth_user, update=auth.user_id,
>                            readable = False, writable = False)
>
>                      )
>
>
>
> db.define_table('journal',
>                 Field('ouid','integer'),
>                 Field('journal',unique=True),
>                 Field('issn', length=10),
>                 Field('notes', type='text'),
>                         signature,
>                 primarykey = ['ouid'],
>                 format=lambda r: r.journal,
>                 migrate = False
>                 )
>
> Traceback (most recent call last):
>   File "/home/js/web2py/gluon/restricted.py", line 188, in restricted
>
>     exec ccode in environment
>   File "/home/js/web2py/applications/init/models/kb4.py" 
> <http://localhost:8000/admin/default/edit/init/models/kb4.py>, line 36, in 
> <module>
>
>     migrate = False
>   File "/home/js/web2py/gluon/sql.py", line 1375, in define_table
>
>     t._create_references()
>   File "/home/js/web2py/gluon/sql.py", line 2303, in _create_references
>
>     raise SyntaxError, 'invalid reference: %s' %ref
>
> SyntaxError: invalid reference: auth_user
>
>
>
> Regards
> Johann
> --
>  May grace and peace be yours in abundance through the full knowledge of
> God and of Jesus our Lord!  His divine power has given us everything we need
> for life and godliness through the full knowledge of the one who called us
> by his own glory and excellence.
>                                                     2 Pet. 1:2b,3a
>
>

Reply via email to