My first thought is that you didn't call parent save method in you
custom save method
super(YourClass, self).save(*args, **kwargs)
On 26 Sie, 03:59, Karen McNeil wrote:
> Thank you Malcolm, you were exactly right!
>
> I would have never thought of that, but I have a custom save method
> and whe
Thank you Malcolm, you were exactly right!
I would have never thought of that, but I have a custom save method
and when I commented it out and restarted the app, setting the active
property worked just as expected. Now I just have to figure out what
the hell is wrong with my save method... :-)
T
Instead of counting the inactive, try counting the active ones. If that
count doesn't go up by one, I'd suspect something's dodgy in your Entry
model's save() that means it doesn't write successfully to the db.
You could debug by doing:
from django.db import connection
connection.queries
e1.save(
No, that's not the problem. Even if I redo the query now, I still get
the same count (see below). And, like I said, the change does not show
up in the admin either -- THE VALUE HAS NOT BEEN CHANGED.
This behavior is so unexpected I'm not sure how to even begin trouble-
shooting it.
~Karen
PS --
The main issue is that your queryset entries wasn't refreshed from the
database. Do your queryset again and you'll see one fewer.
Also, instead of zero you should use False when querying a boolean field.
Shawn
--
You received this message because you are subscribed to the Google Groups "Djang
I have a model "Entry" with an "active" field, which is just a
boolean. All of the current entries were false, and I was trying to
set them all as true, and I'm running into a strange problem. Here's
an example, trying to set just one entry to inactive:
>>> from dictionary.models import Entry
>>
6 matches
Mail list logo