slinkymanbyday / greatlemers-django-tools

Automatically exported from code.google.com/p/greatlemers-django-tools
0 stars 0 forks source link

how to use in template #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i've inserted menu_group and menu_option targets,also load menu_tags,and
insert {% menu_as_ul 'usermenu' %} in suitable place,but got following:
Caught an exception while rendering: 'SafeUnicode' object has no attribute
'generate_hierarchy'

how to fix it?thx

Original issue reported on code.google.com by xur...@gmail.com on 15 Jun 2009 at 12:35

GoogleCodeExporter commented 8 years ago
i used it in base.html that used global site

Original comment by xur...@gmail.com on 15 Jun 2009 at 12:36

GoogleCodeExporter commented 8 years ago
can menu_as_ul tag use menu_group name directly?

Original comment by xur...@gmail.com on 15 Jun 2009 at 12:40

GoogleCodeExporter commented 8 years ago
Hi,

At the moment it does not take the menu_group name directly and requires an 
instance 
of it to be passed into the context.

It does however make sense that it should take the name as a string (or at 
least 
allow both options) so I'll open a feature request to get that added.

--
G

Original comment by greatlemer@gmail.com on 15 Jun 2009 at 6:52

GoogleCodeExporter commented 8 years ago

Original comment by greatlemer@gmail.com on 15 Jun 2009 at 6:54

GoogleCodeExporter commented 8 years ago
thanks for your reply,expecting name directly feature in term of global menu and
performance.
thus far,gtd is suitable for submenu or appmenu.
thanks a lot for your work,benefited me so much.

Original comment by xur...@gmail.com on 15 Jun 2009 at 2:22

GoogleCodeExporter commented 8 years ago
Hi,

I've updated the code to allow strings to be entered as well as menu_group 
instances.  
These strings will then be used to look for a menu_group that has that name.  
Hopefully this will fulfill your use case.

Unfortunately you may need to change the name of the directory you have the app 
stored as it is now be required to be named 'gdt_nav' (if you had called it 
something 
else previously then you may need to dump the current data to a fixture then re-
import it again afterwards).  This had to be enforced due to an issue with the 
way 
django imports template tags not allowing me to use a relative import for the 
models 
and as such I had to hard code the app name in.

--
G

Original comment by greatlemer@gmail.com on 15 Jun 2009 at 10:39

GoogleCodeExporter commented 8 years ago
surprised by your efficiency.i'll try now.thank a lot.

Original comment by xur...@gmail.com on 16 Jun 2009 at 4:42

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
great job.thanks a lot.
a I18N feature for menu options name will be better.:-)

Original comment by xur...@gmail.com on 16 Jun 2009 at 5:20

GoogleCodeExporter commented 8 years ago
added I18N support for menu options

Original comment by xur...@gmail.com on 16 Jun 2009 at 5:38

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

Thank you for the patch to enable I18N on the menu options. I've now applied 
that to 
the code so the feature should be there for everyone.  I18N was something on my 
list 
of things to implement/add but I've not yet found the time to look at it 
properly 
yet.

Does everything else seem to be working now?

--
G

Original comment by greatlemer@gmail.com on 16 Jun 2009 at 7:02

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
it sounds everything go as we want.maybe more tests needed.

Original comment by xur...@gmail.com on 17 Jun 2009 at 2:01