django-livesettings integration

98 views
Skip to first unread message

Lloyd Philbrook

unread,
Apr 13, 2012, 5:54:03 AM4/13/12
to django-ad...@googlegroups.com
Hello,

Awesome package.  It really does make the django admin presentable to clients out the box.  Thanks!

I am trying to integrate django-livesettings.  I created a custommenu (menu.py) file and added a link to the livesettings url (admin/settings).  This works without a problem.  My issue is the application & administration menu are empty when I am on the admin/settings page.  Also, the selected class doesn't seem to be activated on this menu item.  Let me know if you need anymore information.

Thanks in advance.

Lloyd

NENAD CIKIC

unread,
Apr 13, 2012, 12:19:24 PM4/13/12
to django-admin-tools
I also like very much this addin. Since I am django/python newbie it
helps me a lot in developing simple content management system.
I am not familiar with livesetting but if it might help this is what I
do in my custom menu.
In my custom menu inside the init_with_context method if put code
similar to the following:

contextMenu=items.MenuItem(_('Context menu'))
prog = re.compile('^/myproject/auth/user/(\d+)/$')

result=prog.match(context['request'].META['PATH_INFO'])
if result:
userPK=int(re.split('(\d
+)',context['request'].META['PATH_INFO'])[1])
contextMenu.children.append(items.MenuItem(_('Link
admin profile'),url='/myproject/registracija/opcija/linkadmin/%s/' %
userPK))

if contextMenu.children:
self.children.append(contextMenu)

In that way I link custom behaviour in various points.
You could similarly add where you need manually all the models if for
any reason they are not included with AppList.

hth
Nenad

Lloyd Philbrook

unread,
Apr 14, 2012, 3:06:05 AM4/14/12
to django-ad...@googlegroups.com
Nenad,

I assumed I'd have to play around with context.  I'll give it a try.  Thanks.

Lloyd

Lloyd Philbrook

unread,
Apr 14, 2012, 7:40:07 AM4/14/12
to django-ad...@googlegroups.com
The menu items are there.  They just are not displaying on role over.  That was a few wasted hours.  Time to mess with the js and css.

Lloyd Philbrook

unread,
Apr 14, 2012, 11:34:59 AM4/14/12
to django-ad...@googlegroups.com
Ok I figured it out.  The admin/base.css was being called before {{ block.super }}.  just duplicated livesettings/group_settings.html

On Saturday, April 14, 2012 7:40:07 PM UTC+8, Lloyd Philbrook wrote:
The menu items are there.  They just are not displaying on role over.  That was a few wasted hours.  Time to mess with the js and css.

Reply all
Reply to author
Forward
0 new messages