Hi,
I'm using django-reviews <https://github.com/danawoodman/django-reviews/> 
in my site.

Sometimes, reviewed items will be merged by an admin, so, whenever I merge 
Item B to Item A, I also move all the reviews of B to A.

I do it this way:

ReviewedItem.objects.filter(gear = slave).update(object_id = master.id)

Apparently this is not enough, though, because the content_object member of 
ReviewedItem will be None after that.

But if I change the line above to include a "content_object = master" in 
the .update() statement, Django will complain about FieldNotFoundError.

I suppose there's some magic to the GenericForeignKey that I didn't 
understand.

This is the code for the ReviewedItem model: 
https://github.com/danawoodman/django-reviews/blob/master/reviews/models.py#L63

Can anyone tell me how to properly update an instance so it refers to a 
different item?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/AqjsYWy7FYQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to