On Mar 28, 9:16 pm, Josh <[EMAIL PROTECTED]> wrote:
> I've determined that the problem is with the get(). If I just create
> the objects without first checking to see if it already exists,
> there's no problem.
>
> So I guess my question is now this: what's the best way to avoid
> duplicates here?

You can't use the dynamically-generated content_object field as a
lookup. However, you can use content_type and object_id, since these
are explicitly declared in your model. So something like this will
work:

model = ContentType.objects.get_for_model(match)
obj = WordedItem.objects.get(content_type=model, object_id=match.id,
word=word)

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

Reply via email to