Re: url capture + query set and generic views
Ok, It is solved. for those interested I did so: (mysite/urls.py) urlpatterns += patterns('mysite.views', (r'^news/(?P\w+)/$', 'news_category', {}) ) (mysite/views.py) from mysite.news.models import New, NewCategory from django.views.generic.list_detail import object_list def news_category(request, cat_slug=None): news_list = New.objects.filter(category__slug=cat_slug).exclude(is_active=False).order_by('pub_date') return object_list( request, queryset = news_list, template_name = 'news.html' ) Hope it'll help somehow On Sep 24, 1:51 am, aleray <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying capture urls patterns with generic views, something like > this: > > info_dict = { > 'queryset': > New.objects.filter(category__slug=cat_slug).exclude(is_active=False).order_by('pub_date'), > 'template_name': 'news.html', > 'paginate_by': 1, > > } > > urlpatterns += patterns('django.views.generic.list_detail', > (r'^news/(?P\w+)/$', 'object_list', info_dict), > ) > > However, this is not working. Is there a solution? > > thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
url capture + query set and generic views
Hi, I'm trying capture urls patterns with generic views, something like this: info_dict = { 'queryset': New.objects.filter(category__slug=cat_slug).exclude(is_active=False).order_by('pub_date'), 'template_name': 'news.html', 'paginate_by': 1, } urlpatterns += patterns('django.views.generic.list_detail', (r'^news/(?P\w+)/$', 'object_list', info_dict), ) However, this is not working. Is there a solution? thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
docutils extra
Hey, I installed docutils svn version and I couldn't get the documention working (was in the python path) until I found I needed to register in my pythonpath the "extra" directory in the docutils package. Docutils team apparently moved in that directory some libraries needed for django documention (I read somthing about license issues, but can't find the quote anymore). Anyway, it could be nice to write it somewhere on django documentation website. Cheers --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
url templatetag error
Hi, I'm baking a small kind of blog, and I'm trying now to generate a menu for the catgories. I'm using the same view for the main page, and the category pages : (r'^news/$', 'news', {}, 'news-all'), (r'^news/category/(?P\w+)/$', 'news', {}, 'news-cat'), If I enter the url its works (eg. http://localhost/news/ and http://localhost/news/category/general/). In my templates, I can do this: all categorie This last line is unuseful for my project because I want to use slugs instead of id's, so I try : categorie And then I get an error : NoReverseMatch: Reverse for 'www.news-cat' with arguments '('',)' and keyword arguments '{}' not found. What is wrong ? Thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: unregister in old versions of django
Ok, I was affraid of this. Now, I think I will attach a little javascript code to hide what I don't want to see in the admin interface. That's my best option. Thank you very much for helping. Best On Aug 24, 2:01 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sun, Aug 24, 2008 at 6:40 AM, aleray <[EMAIL PROTECTED]> wrote: > > Thanks for the tip, I often forgot the existence of python doc! > > However the thing is in the version of django I'm using there is not > > admin.site, so no API to unregister. Like I said, the models are > > registered with the old fashioned class admin. Then I thought I could > > override that class Admin to define it to None, or something like > > that, in order to cancel its registration. > > In that case the only option you have is to edit the Satchmo code to > remove the admin declarations. There's no way to programmatically > remove models from the old version of the admin. > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: unregister in old versions of django
Thanks for the tip, I often forgot the existence of python doc! However the thing is in the version of django I'm using there is not admin.site, so no API to unregister. Like I said, the models are registered with the old fashioned class admin. Then I thought I could override that class Admin to define it to None, or something like that, in order to cancel its registration. What do you think about ? If I can do like this, any snippet of python would be useful! Otherwhise I'm open to every solution! Best On Aug 24, 1:25 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sun, Aug 24, 2008 at 6:23 AM, James Bennett <[EMAIL PROTECTED]> wrote: > > Which shows you full API documentation for the AdminSite class, > > listing all of its methods and what they do, including this one: > > (and of course if you have DJANGO_SETTINGS_MODULE set properly, > there's also the command-line 'pydoc > django.contrib.admin.sites.AdminSite') > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: unregister in old versions of django
Really no idea ? On Aug 22, 11:01 pm, aleray <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working with django revision 7513 and satchmo 0.7 because I heard > they were doing nice job together. Howerver I would like to unregister > some models in the admin interface, but I can't (and don't want to) > touch to satchmo code. In satchmo 0.7.0, the models are registered > with the admin class; is there a way to "unregister" them? > > Best --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
unregister in old versions of django
Hi, I'm working with django revision 7513 and satchmo 0.7 because I heard they were doing nice job together. Howerver I would like to unregister some models in the admin interface, but I can't (and don't want to) touch to satchmo code. In satchmo 0.7.0, the models are registered with the admin class; is there a way to "unregister" them? Best --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
djangobook embed comments
Hi, I'm looking for the source code used for the the djangobook, using embed comments (the possibility of commenting each paragraph), or I'm looking for clues for how to do this. Best ! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Inline Comments / Django Book
Hi, I'm looking for something similar to the inline comment system used in the Django book. Does anybody know if the code is available somewhere? I also would like to make a change: instead of parsing automatically the text, I would like to add where the comments go by myself. How could I do this? Thxs --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---