Re: django static files css headache

2010-03-05 Thread Mihail Lukin
Instead of passing media_url to each view, I do the following: 1) in my urls.py I put: ... url(r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}, 'media'), ... 2) in my templates I put: ... ... On Mar 4, 1:57 am, "mendes.rich...@gmail.com" wrote: >

Changing arguments of field inherited from abstract model class

2010-03-01 Thread Mihail Lukin
Hi, Community I'm looking for a hack to change default value of field inherited from abstract model class. Example: class StuffBase(models.Model): access_level = models.IntegerField(default=0) class Meta: abstract = True class StuffA(StuffBase): data = models.XMLField() cla

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread Mihail Lukin
Look at date_based.py: if date_list and num_latest: latest = queryset.order_by('-'+date_field)[:num_latest] else: latest = None So, if you use num_latest=None, you will always get the whole list. On Aug 30, 2:47 pm, tezro wrote: > Anyone? > > On Aug 14, 8:29 am, tezro

Re: QuerySet rendering

2009-07-16 Thread Mihail Lukin
Thanks, Alex! I met something about django-tables somewhere and looks good. I wonder why it is not a part of djangoproject. On Jul 14, 1:55 am, Alex Gaynor wrote: > On Mon, Jul 13, 2009 at 2:48 PM, Mihail Lukin > wrote: > > > > > > > Hello, everyone! > > > d

QuerySet rendering

2009-07-13 Thread Mihail Lukin
Hello, everyone! django.forms allows me to define form class from model and render forms to html with just calling as_table method. Is there some module to do same thing with querysets? I guess its usage could look like this: class UserTable (tables.ModelTable): class Meta: model = U