I'm quite new to django/python (migrating from php). I've been
developing cms-like web applications for years now. Now I'm trying to
create quite advanced CMS using django. Lately I moved from doing
simple tests in django to tearing other peoples django apps into
pieces to get the idea of best practices when using django.

The thing I dont know is where do I put code for processing side (left/
top/right/foot) componets of webpage. Simple examples show just how to
display content of one component into what I'd "center content area".
But where should I process small side components (like box of latest
news leads and such) which should be shown on every subpage.

I'm sure there is more proper way of doing this other way than:

def my_view_1(request):
        process_side_subpage_components()
        # below process all stuff formy_view_1()

def my_view_2(request):
        process_side_subpage_components()
        # below process all stuff formy_view_2()

etc...

In php I've writtent small OOP framework for myself and it basicly
worked like this:

* AbstractPage - class defining page methods, basic behaviour and
convention of use. (common for each project)
* ProjectPage extends AbstractPage - processing all subpage side
components. (customized for each project)
* ComponentViewPage extends ProjectPage - processing all data for
currently displayed component. (common or customized depending on
project)


And when "ComponentViewPage" was being processed, all the common side
components were automaticly processed too because this page inherited
its behaviour from ProjectPage.

What would be most elegant and most efficient way to do that in Django?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to