This cannot be:

default=db.contacts.id

- syntactically because the right hand side has to be a field value
not a field object.

- logically because you need the id value to fill the field before the
record is created but an id is assigned donly after the record is
created

- this causes duplication of information (attempts to put id is in two
places) and it is to be avoided.

Perhaps if you explain us why you want to do this, we can suggest a
better way.

Massimo


On Oct 26, 5:20 am, shukalo83 <shukal...@gmail.com> wrote:
> Hello!
>
> I'm new to web2py and need something like this. I'm opened  to all
> kind of suggestions
>
> db.define_table('contacts',
>                             Field('first'),
>                             Field('last'),
>
> Field('jmbg',unique=True,default=db.contacts.id),   #this doesn't work
> but, if nothing is entered here I need it to be id      value
>
> Field('jib',unique=True,default=db.contacts ))

Reply via email to