I have created a custom tag to generate select inputs from my database
models it is registered as a simple tag.
Everything is fine, except that I should do this to avoid my problem
is that calling my tag of this way {% combo "model"
instance.property.id %} raises TemplateSyntaxError when object is
None. right now I should do this:
{% if instance.property %}
{% combo "model" instance.property.id %}
{%else%}
{% combo "model" %}
{%endif%}
Is there a cleaner way to avoid the error ?
Thanks...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---