Re: ANN: newforms-admin syntax change for inlines

2008-07-16 Thread Joost Cassee
Hi all, On 9 sep 2007, 14:36, "Honza Král" <[EMAIL PROTECTED]> wrote an example newforms-admin snippet that would programmatically add an inline: > class CommentOptions( models.Model ): >   enabled = models.Fireld() >   moderators = models.Field() >   ... > > for model, model_options in

Re: ANN: newforms-admin syntax change for inlines

2007-09-10 Thread pm13
On 10 Zář, 02:32, "Joseph Kocherhans" <[EMAIL PROTECTED]> wrote: > > But I think anyway that there should be some kind of caching by > > default. It isn't only my problem - it may be quite usual to use > > inlines with more rows and with foreign keys. (I will try to give > > better description

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread pm13
> > I created example of the first solution: > >http://code.djangoproject.com/ticket/5372 > > The patch you attached in that ticket looks like it will solve your > problem, and in fact, you can just subclass TabularInline or > StackedInline, override the formfield_for_dbfield on you subclass, and

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread Joseph Kocherhans
On 9/9/07, pm13 <[EMAIL PROTECTED]> wrote: > > I think that there was call of function "formset_for_model" in each > request (ModelAdmin.get_inline_formsets -> inline_formset -> > formset_for_model). But now this method is called from > ModelAdmin.__init__ (ModelAdmin.__init__ ->

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread pm13
I have a problem with this changeset. I have some inlines with foreign keys. By default there is one SQL query for each row - result is not cached. So I used this code in formfield_for_dbfield: if isinstance(db_field, models.ForeignKey): kwargs['cache_choices'] = True The argument

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread Joseph Kocherhans
On 9/8/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > If you use the newforms-admin branch and the edit inline > functionality, you want to read this. > > I'm planning on breaking the current syntax for defining inlines in > the very near future, but I figured I'd warn people and ask for >

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread Malcolm Tredinnick
On Sun, 2007-09-09 at 10:56 -0500, Joseph Kocherhans wrote: [...] > I suppose I could make the syntax backwards-compatible by naming the > factory functions the same as the existing classes, but I think it > would make things more confusing. I think you're more across the subtleties of this

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread Joseph Kocherhans
On 9/9/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 9/9/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > > > If you use the newforms-admin branch and the edit inline > > functionality, you want to read this. > > > > I'm planning on breaking the current syntax for defining inlines

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread Honza Král
On 9/9/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 9/9/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > > > If you use the newforms-admin branch and the edit inline > > functionality, you want to read this. > > > > I'm planning on breaking the current syntax for defining inlines

Re: ANN: newforms-admin syntax change for inlines

2007-09-09 Thread Russell Keith-Magee
On 9/9/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > If you use the newforms-admin branch and the edit inline > functionality, you want to read this. > > I'm planning on breaking the current syntax for defining inlines in > the very near future, but I figured I'd warn people and ask for >

ANN: newforms-admin syntax change for inlines

2007-09-08 Thread Joseph Kocherhans
If you use the newforms-admin branch and the edit inline functionality, you want to read this. I'm planning on breaking the current syntax for defining inlines in the very near future, but I figured I'd warn people and ask for comments first. Currently it's something like this: class