'never_cache' decorator doesn't really prevent the page from being cached

2007-09-06 Thread Przemyslaw Wegrzyn
Hi! I've tried to use never_cache from django.views.decorators.cache, however my page was still getting cached by my ISP's transparent proxy and/or my browser. I've checked that the headers that this decorator adds were e.g.: Expires: Thu, 06 Sep 2007 19:08:26 GMT Last-Modified: Thu, 06 Sep 2007

Re: Best practice for non-root base URL setup?

2007-08-18 Thread Przemyslaw Wegrzyn
John Shaffer wrote: >On 8/18/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > > >>However Django 0.96 doesn't support named URL patters yet, so I can't >>use {% url %} tag. >> >> > >Even in 0.96, you can use a view as the argu

Re: Best practice for non-root base URL setup?

2007-08-18 Thread Przemyslaw Wegrzyn
Chris Moffitt wrote: > We've developed a similar sort of capability for Satchmo. You can > browse the source here- > http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo > Seems I've done more or less the same in my

Best practice for non-root base URL setup?

2007-08-17 Thread Przemyslaw Wegrzyn
Hi! I'd like my customer to be able to deploy my Django application at http://host/some/custom/path/. Deployment is going to use Apache, not yet decided between mod_python and (more likely) FastCGI. One option I see is to use a configurable prefix for all regexp's in top-level url.py, then use {

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Przemyslaw Wegrzyn
Peter Melvyn wrote: >>Thanks! I overlooked the 'fixtures' feature, I'll give it a try. >> >> > >I don't know wjhat kind of SQL server do you use, but If I'm not >mistaken, fixtures are not fully supported on MySQL with InnoDB >engine. > > Yes, I've found such warning in the documentation.

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Przemyslaw Wegrzyn
Andrey Khavryuchenko wrote: > PW> One option I see is to add custom statements to one of SQL files used to > PW> initialize my application's model. Yet it's a bit ugly, isn't it ? > >Create this data in console or in the script and then use > manage.py dumpdata >to save then in json format.

Auth framework - initials et of users/groups ?

2007-07-24 Thread Przemyslaw Wegrzyn
Hi! I'm just trying to do is using django.contrib.auth framework. What I'd need is the possibility to create initial set of groups, users and user-group assignements, when 'syncdb' is performed. One option I see is to add custom statements to one of SQL files used to initialize my application's

oldforms advice - how to validate

2007-06-08 Thread Przemyslaw Wegrzyn
Hi! I have the following construct in my model: class SomeObject(models.Model): type = models.ForeignKey(SomeObjectType) ... a few other fields... I want to present a form for editing SomeObject, with drop-down list for 'type' field. However I want to apply different validation rules fo

Re: Best way to strip form data

2007-06-08 Thread Przemyslaw Wegrzyn
Malcolm Tredinnick wrote: >I can't think of a way off the top of my head to do this with generic >views. With a manually created (old)form, you could do this by >sub-classing oldforms.TextField and putting a prepare() method in the >sub-class that does the stripping, I guess, but then you are no

Re: Customizing validation error messages

2007-06-08 Thread Przemyslaw Wegrzyn
Malcolm Tredinnick wrote: >You don't explain whether you are using oldforms or newforms here. > > Right - at the moment using oldforms with generic views, I'm not yet really familiar with newforms. I'm quite new to Django :) >For newforms, override the Field class(es) that you wish to customis

Customizing validation error messages

2007-06-08 Thread Przemyslaw Wegrzyn
Hi! How can I customize a validation error message? Looking at the code of any validator I can see that it uses gettext(), so I can use i18n mechanisms to customize the message. But I'm not too happy with that. What if I want the message to be generated dynamically based on the actual data (Like

Re: Best way to strip form data

2007-06-08 Thread Przemyslaw Wegrzyn
Malcolm Tredinnick wrote: >>I have some CharField's in my model, I'm using create_update generic >>views to edit them. I need all text data to be strip()'ed before being >>saved to database. How can this be done in the most simple way? >> >> > >In the model's save() method. > > Hmm, is ther

Best way to strip form data

2007-06-07 Thread Przemyslaw Wegrzyn
Hi! I have some CharField's in my model, I'm using create_update generic views to edit them. I need all text data to be strip()'ed before being saved to database. How can this be done in the most simple way? More general question - is there any elegant way to use custom manipulators with create_