Re: Format dates using a specific locales under mod_python

2009-05-28 Thread luper rouch
2009/5/29 Graham Dumpleton : > > > > On May 28, 10:16 pm, luper rouch wrote: >> By default, dates are formated in English (things like .strftime("%A") >> return days names in English). >> >> I tried to put locale.setlocale(locale.LC_TIME, 'fr_F

Format dates using a specific locales under mod_python

2009-05-28 Thread luper rouch
By default, dates are formated in English (things like .strftime("%A") return days names in English). I tried to put locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') in the settings file and it works well on the development server. The problem is under mod_python dates are printed in the selected

Creating formsets through AJAX

2008-11-19 Thread Luper Rouch
Hi, I am running into an annoying problem when trying to create formsets dynamically. I have a script that sends JSON data to a view to render it as a formset. The response is then inserted in the page: Script: data = JSON.stringify([1, 2, 3]); $("#container").load("render-form/", {data: data

Serializing custom fields

2008-05-09 Thread Luper Rouch
I have a db.models.Field subclass that needs a special representation in the database. This is achieved by implementing get_db_prep_save() and using SubfieldBase as the metaclass, and works fine. The problem comes when serializing, the custom field is serialized using the python's form string

Applications imports best practices ?

2007-05-30 Thread Luper Rouch
Hi list, What is the proper way to import modules within an application ? For example if I have a project "foo" containing an application "bar", how should I import things in bar's modules ? 1. import foo.bar.module the source code has to be modified when using bar in another project 2. imp