In case anyone's interested:
I still don't know what the problem was, but I solved it by just doing a
delay call to a Celery task, so it happens asynchronously.
I was already using Celery/RabbitMQ, and the functionality was one of
the things I wanted to make async anyway.
--
You received th
On 08/18/2011 09:24 AM, Andre Terra wrote:
Your instance is probably not yet saved to the database, so the
m2m-related objects don't know which instance to connect to. There's
problem something wrong in your save() method. I often use "assert
False, some_var" to check if at some point the variabl
Your instance is probably not yet saved to the database, so the m2m-related
objects don't know which instance to connect to. There's problem something
wrong in your save() method. I often use "assert False, some_var" to check
if at some point the variable is already set or not.
And I get the same
On Thu, Aug 18, 2011 at 4:44 AM, Shawn Milochik wrote:
> I have some code that modifies related items when a model is saved. I've
> tried this by both using a post_save signal and by putting the code directly
> in a save() override.
>
> When I save an instance in the Django admin, it never works.
I had similar problems, but I put it down to doing something 'unusual'.
Try setting a pdb breakpoint in your admin class, and see if there is
anything odd. I found that I was getting failures due to save(commit=False)
meaning that an object had no primary key, and I had to do some fancy stuff
t
I have some code that modifies related items when a model is saved. I've
tried this by both using a post_save signal and by putting the code
directly in a save() override.
When I save an instance in the Django admin, it never works.
When I save an instance in ./manage.py shell it always works.
6 matches
Mail list logo