NameError: name 'uuid' is not defined

2,935 views
Skip to first unread message

Johann Spies

unread,
Apr 14, 2011, 4:53:28 AM4/14/11
to web...@googlegroups.com
Why do I get this error?  The code causing this error:

from uuid import uuid4

signature = db.Table(db, 'signature',
                     Field('uuid', length=64, default=uuid.uuid4(), notnull=True,
                           writable=False, unique=True),
                     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)
                     )

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

Johann Spies

unread,
Apr 14, 2011, 5:46:45 AM4/14/11
to web...@googlegroups.com
Apologies for a stupid question.

On 14 April 2011 10:53, Johann Spies <johann...@gmail.com> wrote:
Why do I get this error?  The code causing this error:

from uuid import uuid4


Should have been
import uuid
 
Regards
Reply all
Reply to author
Forward
0 new messages