django-treemenus icon indicating copy to clipboard operation
django-treemenus copied to clipboard

Select related extensions

Open erlingbo opened this issue 13 years ago • 1 comments

Added possibility to select related extensions in models.MenuItem.children(). Requires new setting TREEMENUS_EXTENSION_RELATED_NAME set to the name of the relation.

This will reduce the number of SQL queries needed when using menu extensions.

Docs are updated accordingly.

erlingbo avatar Aug 06 '11 22:08 erlingbo

That sounds good, although instead of catching an AttributeError it'd be nicer to test for the existence of that setting. Could you also add some tests, probably using assertNumQueries (https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCase.assertNumQueries). Thanks!

jphalip avatar Oct 18 '11 03:10 jphalip