On Sat, Feb 5, 2011 at 6:48 PM, Marc Aymerich <glicerinu@gmail.com> wrote:
On Sat, Feb 5, 2011 at 9:21 AM, Ken Chida <ken.chida@gmail.com> wrote:it sounds to me like you need a custom decorator for your views, I
> I tried my best to search for an answer but my efforts yielded nothing.
> Allow me to give you a simple example to illustrate my problem. Let's
> pretend that I want to have a login form on every single page on my
> website. Obviously, the login form will have a corresponding view
> function. What is the most elegant way to implement the login functionality
> on every single page? One brute force method would be to include the login
> view inside all view functions for every page; these view functions would
> call the login view if the HttpRequest object contains a flag that becomes
> active when the user clicks the login submit button. This method would
> work, but it goes against DRY best practices.
>
> Is there a better way to do this? Maybe I can use a custom template tag?
can't give you more details since I've never written one.
--
Marc
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
--
===========================
Regards
Ronghui Yu
--
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 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