so is the db.auth_user the problem or the default=user_id

I took the default=user_id from the db.py in the book:

if auth.is_logged_in():
    user_id = auth.user.id
else:
    user_id = None

book page 72

On Wed, Nov 18, 2009 at 4:47 PM, mdipierro <[email protected]> wrote:
>
> The default for a reference field must be None or an int or a string
> containing and int. It cannot be an empty string. It is ambiguous. It
> is not clear if it should be a None or a 0.
>
> On Nov 18, 4:48 pm, Wes James <[email protected]> wrote:
>> What does this mean:
>>
>>     form=crud.create(db.student,next=URL(r=request))
>>   File "/opt/cnrsa/gluon/tools.py", line 2101, in create
>>     deletable=False,
>>   File "/opt/cnrsa/gluon/tools.py", line 2048, in update
>>     keepvalues=self.settings.keepvalues):
>>   File "/opt/cnrsa/gluon/sqlhtml.py", line 865, in accepts
>>     fields[fieldname] = int(fields[fieldname])
>> ValueError: invalid literal for int() with base 10: ''
>>
>> I get it with this:
>>
>> SQLField("sid",db.auth_user, default=user_id),
>>
>> but not with this:
>>
>> SQLField("sid",default=user_id),
>>
>> -wes
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to