Re: Model Inheritance - best practice for templates?

2010-02-24 Thread fgasperino
mis-clicked, continuing: @register.filter def A_get_B(instance):     if isinstance(instance, B):         return instance.b     try:         return instance.b     except B.DoesNotExist:         return None and lastly, the template: {% with a|A_get_B as b %} {% if b %} .. work with b {%

Model Inheritance - best practice for templates?

2010-02-24 Thread fgasperino
All, Currently I'm working with the following 2 models: class A (models.Model): ... class B (A): somefield = ... I have a generic views with querysets defined as: url(r"A/view/(?P\d+)/$", "django.views.generic.list_detail.object_detail", dict(queryset = A.objects.all(), template_name =