On Sun, 2008-10-19 at 12:29 -0700, Scott SA wrote: > When passing a QuerySet of objects which inherit part of their model > from another class, generic views only seems to respond to the parent > class: > > Here's a simplified example: > > class ParentClass(models.Model): > name_last = models.CharField(max_length=64) > name_first = models.CharField(max_length=64) > > class ChildClass(ParentClass): > likes_spam = BooleanField(default=False) > > Then, in the urls.py, I pass: > { > "queryset": ChildClass.objects.all() > .... > } > > Without specifying the template, generic views looks for > "parentclass_list.html", not "childclass_list.html".
That doesn't sound right. The model name is taken from the queryset's model attribute, which will be ChildClass, and then the template name will be ChildClass._meta.object_name.lower(), which will be "childclass". Which generic view are you calling that is exhibiting this behaviour? I can't repeat it here and reading the code for a few random generic views show that they're all doing the same thing when it comes to constructing the template name. Can you construct a short, complete example of two classes and a URL pattern that demonstrates this problem? Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---