Re: Error in formfield in django.db.models.field

2011-11-14 Thread ptone
On Nov 13, 11:55 pm, Ric wrote: > the field class define this code > >     def formfield(self, form_class=forms.CharField, **kwargs): >         """ >         Returns a django.forms.Field instance for this database Field. >         """ >         defaults = {'required': not self.blank, >          

Re: Error in formfield in django.db.models.field

2011-11-14 Thread Ric
yes but definitely not the current code, because i cannot subclass with super On 14 Nov, 15:46, ptone wrote: > On Nov 13, 11:55 pm, Ric wrote: > > > > > > > > > > > the field class define this code > > >     def formfield(self, form_class=forms.CharField, **kwargs): > >         """ > >         R

Re: Multi-DB support within transaction middleware

2011-11-14 Thread David Winterbottom
There's merit in both the responses. Since it's trivial to write your own transaction middleware, I would say the most important thing is to document that the middleware only affects your 'default' database. Then it's up to the developer to decide if they need anything further. On Sun, Nov 13, 2

Using Django DB connections outside request

2011-11-14 Thread Anssi Kääriäinen
I am wondering about how to properly close connections if you use the ORM outside requests. For requests this is done in django/db/ __init__.py: """ # Register an event that closes the database connection # when a Django request is finished. def close_connection(**kwargs): for conn in connectio

mark_safe(media) in django admin

2011-11-14 Thread Ric
a minor bug in django admin. in django.contrib.admin.options mark_safe is called to render media. in add_view and change_view we can find mark_safe(media) in changelist_view media is injected as an object (without mark_safe) i propose to pass the media object to the template (without mark_safe),

Re: Error in formfield in django.db.models.field

2011-11-14 Thread Ric
form_class is not in kwargs if the method is declared like this def formfield(self, form_class=forms.CharField, **kwargs): a possible solution is to use a code like this def formfield(self, **kwargs): form_class = kwargs.pop("form_class", self.choices and forms.TypedChoiceField or forms.Char

Re: mark_safe(media) in django admin

2011-11-14 Thread Aymeric Augustin
On 14 nov. 2011, at 23:15, Ric wrote: > a minor bug in django admin. Could you open a ticket in our bug tracker? https://code.djangoproject.com/newticket Thanks, -- Aymeric Augustin. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To