I'm trying to implement a very basic tagging function using generic  
relations, and running into errors I don't understand. The basic setup  
is, I've got a model called Series, and series should be linkable to  
many models via a SeriesItem model. Following the instructions here:
http://www.djangoproject.com/documentation/contenttypes/#reverse-generic-relations
I'm trying to add a reverse generic relation to another model, called  
Entry, with the line:
series = generic.GenericRelation(SeriesItem)

When I try to view an Entry object in the admin, it gives me a  
KeyError, saying "Could not find Formfield or InlineObjectCollection  
named 'series'". I don't really know what this means...

I'm running trunk, and my Series and SeriesItem models are as simple  
as can be:

class Series(models.Model):
     name = models.CharField(max_length=100)
     slug = models.SlugField(prepopulate_from=('name',))
     desc = models.TextField("Description", blank=True)

class SeriesItem(models.Model):
     series = models.ForeignKey(Series)
     content_type = models.ForeignKey(ContentType)
     object_id = models.PositiveIntegerField()
     content_object = generic.GenericForeignKey('content_type',  
'object_id')

Here's my traceback, any help would be appreciated...


Traceback:
File "/Library/Python/2.5/site-packages/django-trunk/django/contrib/ 
admin/views/main.py" in change_stage
   406.     return render_change_form(model, manipulator, c,  
change=True)
File "/Library/Python/2.5/site-packages/django-trunk/django/contrib/ 
admin/views/main.py" in render_change_form
   205.     bound_field_sets = [field_set.bind(context['form'],  
original, AdminBoundFieldSet) for field_set in field_sets]
File "/Library/Python/2.5/site-packages/django-trunk/django/contrib/ 
admin/views/main.py" in __init__
   190.         self.bound_field_lines =  
[field_line.bind(field_mapping, original, AdminBoundFieldLine) for  
field_line in field_set]
File "/Library/Python/2.5/site-packages/django-trunk/django/contrib/ 
admin/views/main.py" in __init__
   173.         self.bound_fields = [field.bind(field_mapping,  
original, AdminBoundField) for field in field_line]
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/ 
fields/__init__.py" in bind
   387.         return bound_field_class(self, fieldmapping, original)
File "/Library/Python/2.5/site-packages/django-trunk/django/contrib/ 
admin/views/main.py" in __init__
   120.         self.form_fields = [field_mapping[name] for name in  
self.field.get_manipulator_field_names('')]

Exception Type: KeyError at /admin/wblog/entry/78/
Exception Value: "Could not find Formfield or InlineObjectCollection  
named 'series'"

--~--~---------~--~----~------------~-------~--~----~
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