I have installed third party app(Mezzanine) whose urls are configured to 
use their view functions not View Class. Source code from 
mezzanine.blog.urls

       urlpatterns = patterns("mezzanine.blog.views",16 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/urls.py#16>
   url("^%stag/(?P<tag>.*)%s$" % _slashes, "blog_post_list",

21 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/urls.py#21>
        name="blog_post_list_tag"),

18 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/urls.py#18>
 
... 44 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/urls.py#44>
)

As we can see they have configured blog URLs to use mezzanine.blog.views. Here 
we have few functions which are being called by URL dispatcher.  one of them is 
below.

*       def* blog_post_list(request 
<http://localhost:8888/source/s?defs=request&project=sonus>, tag 
<http://localhost:8888/source/s?defs=tag&project=sonus>=*None*, year 
<http://localhost:8888/source/s?defs=year&project=sonus>=*None*, month 
<http://localhost:8888/source/s?defs=month&project=sonus>=*None*, username 
<http://localhost:8888/source/s?defs=username&project=sonus>=*None*,20 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#20>
                   category 
<http://localhost:8888/source/s?defs=category&project=sonus>=*None*, 
template="blog <http://localhost:8888/source/s?path=blog/>/blog_post_list.html 
<http://localhost:8888/source/s?path=blog/blog_post_list.html>",21 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#21>
                   extra_context 
<http://localhost:8888/source/s?defs=extra_context&project=sonus>=*None*):22 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#22>
    """23 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#23>
    Display a list of blog posts that are filtered by tag, year, month,24 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#24>
    author or category. Custom templates are checked for using the name25 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#25>
    ``blog <http://localhost:8888/source/s?path=blog/>/blog_post_list_XXX.html 
<http://localhost:8888/source/s?path=blog/blog_post_list_XXX.html>`` where 
``XXX`` is either the26 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#26>
    category slug or author's username if given.27 
<http://localhost:8888/source/xref/sonus/env/lib/python2.7/site-packages/mezzanine/blog/views.py#27>
    """

I would like to override this function so that it will call my function to 
update context dictionary  or pass some more arguments to default function 
blog_post_list (it's having an argument extra_context so we can use this as 
external context) 


How can I achieve this ?

 Please provide complete details like do we have to modify urlpatterns then 
what should be changed, if we have to change view then what should be change ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/47eabec2-fdb1-47a8-b9f8-8f158c29852f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to