Closed GoogleCodeExporter closed 9 years ago
Thank you for the report. I understand your use case, however at this stage I
prefer
to let it raise an exception if the menu does not exist. You can always write
your
own custom template tag to allow this behaviour.
If you, or someone else, has a compelling reason for letting it fail silently,
then
please re-open this ticket and I'll re-consider it.
An alternative could also be to add an extra argument to the template tag:
def show_menu(context, menu_name, menu_type=None, fail_silently=False):
try:
context['menu'] = menu
if menu_type:
context['menu_type'] = menu_type
return context
except Menu.DoesNotExist:
if fail_silently:
return context
else:
raise
Original comment by jpha...@gmail.com
on 6 Dec 2009 at 5:59
Sounds good, I respect your opinion. Love the tool, it's great work!
Cheers
Original comment by woodman....@gmail.com
on 7 Dec 2009 at 8:17
Original issue reported on code.google.com by
woodman....@gmail.com
on 1 Dec 2009 at 5:16Attachments: