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". After specifying
which template to use, the ChildClass attributes are available via the
1:1 relationship so {{ object.childclass.likes_spam }} will retrieve
the desired attribute.

Where I've been caught with this is I'm inheriting from a generic
application that is not in my project directory. So not only was
django looking for parentclass_list.html and paentclass_detial.html,
it was looking for base_app/parentclass.html, etc.

I expected it to look in derived_app/childclass_list.html, etc.

Is this how this _should_ work, or should I post this to the developer
list and see what shakes?

Thanks,

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