else:
raise Http404
On line 27 color is red. Usually the error related to SimpleLazyObject
means that it's not able to grab the field with reference. I don't know
what to replace it with.
On Wed, Aug 31, 2016 at 5:31 AM, Andromeda Yelton <
andromeda.yel...@gmail.com
rs\Shazia\dd\lib\site-packages\django\db\models\fields\related.py"
> in get_lookup_constraint
> > 1745. lookup_class(target.get_col(alias, source),
> val), AND)
> > File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py"
> in
b\models\lookups.py"
in __init__
> 101. self.rhs = self.get_prep_lookup()
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py"
in get_prep_lookup
> 139. return
self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
> File
"C
; return
>> render_to_response('generic_error.html',data,context_instance=RequestContext(request))
>>
>> This causes a DatabaseError, because it crashes when it reaches the
>> user.is_authenticated template variable. The crashed seems to be caused
>> because of the
; render_to_response('generic_error.html',data,context_instance=RequestContext(request))
>
> This causes a DatabaseError, because it crashes when it reaches the
> user.is_authenticated template variable. The crashed seems to be caused
> because of the SimpleLazyObject around the
ser.is_authenticated template variable. The crashed seems to be caused
because of the SimpleLazyObject around the User instance. It seems it's not
correctly setup, or whatelse... I don't know.
This problem disappears if I use the __dummy__ variable in the previous
snippet.
This call seems to make
e of your arguments. An
> anonymous user is a SimpleLazyObject; it is a user but there is no
> reference to it on your databases. The Bookmark foreign key expects to
> point to user instance on the users table.
>
> Thank you,
> Victor Rocha
> www.RochApps.com
>
>
>
> On Fri
This is a wild guess but I do not see the login_required decorator on your
view. I think you are getting this error because you are trying to save an
Bookmark object passing an anonymous user as one of your arguments. An
anonymous user is a SimpleLazyObject; it is a user but there is no
l Service
> Sent: 7/12/2013 8:46 PM
> To: django-users@googlegroups.com
> Subject: Re: 'SimpleLazyObject'
>
> Here's the traceback info:
>
> Environment:
>
>
> Request Method: POST
> Request URL: http://localhost:8000/save/
>
--
From: Kakar Arunachal Service
Sent: 7/12/2013 8:46 PM
To: django-users@googlegroups.com
Subject: Re: 'SimpleLazyObject'
Here's the traceback info:
Environment:
Request Method: POST
Request URL: http://localhost:8000/save/
Django Version: 1.5.1
Python
lated.py" in
_pk_trace
216. v = getattr(field, prep_func)(lookup_type, v, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py" in
get_prep_lookup
322. return self.get_prep_value(value)
File "C:\Python27\lib\site-packages\dja
've got a TypeError:
>
> int() argument must be a string or a number, not 'SimpleLazyObject'
>
>
> Here's my view:
>
> def bookmark_save_page(request):
> if request.method == 'POST':
> form = BookmarkSaveForm(request.POST
I've got a TypeError:
int() argument must be a string or a number, not 'SimpleLazyObject'
Here's my view:
def bookmark_save_page(request):
if request.method == 'POST':
form = BookmarkSaveForm(request.POST)
if form.is_valid():
I recently got burned by r11626, which added SimpleLazyObject to
1.1.x. I have a templatetag that linkifies a user-object, and it
checks whether it is given a django.contrib.auth.models.User, an int
(looks up a User) or a profile (looks up the User). This check was
done with type(). Unfortunately
Went ahead and filed a ticket for this. If you would chime in with
your example it probably wouldn't hurt, but I will link to this thread
as well.
http://code.djangoproject.com/ticket/12060
Cheers,
Eric
--~--~-~--~~~---~--~~
You received this message because you a
arket)
The filter has begun to return false always. The problem seems to be
that the 'user' instance is of 'SimpleLazyObject' instead of PMUser (a
subclass of User). Searching it up on the internet brought me to
Ticket #12049, which indicates that this may be a similar bug
(however,
16 matches
Mail list logo