Sunday, April 1, 2012

plugins django-apps in sidebar with eval()

i want made a plugin sistem  for one CMS  my idea is:

#plugin
def plugin ():
    do somting
    return render_to_string('plugin.html',{})

and  one database whit plugins  method name  "Plugin_sidebar"

#view
def home(request):
    ps = Plugin_sidebar.objects.all()
    return render_to_response('home.html',{'ps':ps})


and  template whit custom tag  eval()

{%for  item in  ps %}
{%eval  item%}   #custom tag
{%endfor%}


with this sistem the user can add and remove plugins... what do you think?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/LhdpKj6M3tUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment