How to customize the formset of InlineModelAdmin?

2018-11-23 Thread Huan Lu
How to customize the formset of InlineModelAdmin. Purpose: I want to customize the fields in InlineModelAdmin because I want to hide some fields. My attempt: class SKUInline(admin.TabularInline): model = models.SKU formset = modelformset_factory(models.SKU, fields=('values

How to customize the formset of InlineModelAdmin.

2018-11-23 Thread Huan Lu
How to customize the formset of InlineModelAdmin. Purpose: I want to customize the fields in InlineModelAdmin because I want to hide some fields. My attempt: class SKUInline(admin.TabularInline): model = models.SKU formset = modelformset_factory(models.SKU, fields=('values

Applying filter_horizontal to an inlinemodeladmin instance?

2017-08-07 Thread Bass'd God
According to Django documentation it's possible. filter_horizontal is supposed to extend to InlineModelAdmin. But I've been at a pretty bad stopping point of not knowing the syntax for how to get this to work, and not being able to even find an example of someone doing this. I ha

modifying InlineModelAdmin data before rendering add/edit item page in django admin

2013-02-22 Thread elmosanches
I'm going to prepare multilanguage cms django app and I need to enable in django admin adding and editing entries with content in many languages. My idea is to have a separated record for content in each language and relate it to the entry like in the example: *setting.py* LANGUAGES = ( ('en

Re: Force the user to add an instance of some InlineModelAdmin when adding a model

2012-04-19 Thread Daniel Sokolowski
From: Oscar Mederos Sent: Thursday, April 19, 2012 7:24 AM To: django-users@googlegroups.com Subject: Force the user to add an instance of some InlineModelAdmin when adding a model I have a UserAdmin, and I defined a UserProfileInline like this: - from ... from django.contrib.auth.

Force the user to add an instance of some InlineModelAdmin when adding a model

2012-04-19 Thread Oscar Mederos
I have a UserAdmin, and I defined a UserProfileInline like this: - from ... from django.contrib.auth.admin import UserAdmin as UserAdmin_ class UserProfileInLine(admin.StackedInline): model = UserProfile max_num = 1 can_delete = False verbose_name = 'Profile' ver

Re: A little InlineModelAdmin help please?

2012-03-16 Thread Jeff Blaine
Thanks for the reply, Marc. On Thursday, March 15, 2012 4:32:48 PM UTC-4, Jeff Blaine wrote: > > Easier for me to just draw you a picture: > >++ >| noodle | >++ > | | >

Re: A little InlineModelAdmin help please?

2012-03-15 Thread Marc Aymerich
On Thu, Mar 15, 2012 at 9:32 PM, Jeff Blaine wrote: > Easier for me to just draw you a picture: > >            ++ >            |   noodle               | >            ++ >                 |             | >                 |             | >          

A little InlineModelAdmin help please?

2012-03-15 Thread Jeff Blaine
Easier for me to just draw you a picture: ++ | noodle | ++ | | | | +-+ ++ ||

InlineModelAdmin show dropdown in Many to Many models

2012-01-02 Thread Enrique Juan de Dios
Hi everyone. I'm newbie on Django and use Grappelli for admin site. Files related: https://gist.github.com/1553188 When I use a one to many relation the admin shown this one: But

Using arbitrary queries to populate InlineModelAdmin instances

2011-01-17 Thread Dan Farina
Hello list, I have a use case where I want to show a few other objects as inline editable fields, but have been stymied by the fact that there exists no direct foreign key relationship between them. Here is an example: Outermost_Model -> Inner_Model -> Django User Model, where '->' is a foreign k

Re: Setting list_display for InlineModelAdmin

2010-04-21 Thread Brad Pitcher
Thank you for setting me straight. What a dumb mistake. :) On Apr 21, 11:03 am, Daniel Roseman wrote: > On Apr 21, 3:20 pm, Brad  Pitcher wrote: > > > Hi guys, > > This is driving me a little crazy, so I hope someone can offer good > > advice.  I've specified an inline class in my admin.py fil

Re: Setting list_display for InlineModelAdmin

2010-04-21 Thread Daniel Roseman
On Apr 21, 3:20 pm, Brad Pitcher wrote: > Hi guys, > This is driving me a little crazy, so I hope someone can offer good > advice.  I've specified an inline class in my admin.py file, and in it > I have specified a subset of the classes attributes with > list_display.  However, what I set in list

Setting list_display for InlineModelAdmin

2010-04-21 Thread Brad Pitcher
Hi guys, This is driving me a little crazy, so I hope someone can offer good advice. I've specified an inline class in my admin.py file, and in it I have specified a subset of the classes attributes with list_display. However, what I set in list_display has no effect on what is rendered for the i

Re: InlineModelAdmin related items on two levels

2010-02-14 Thread Ogi Vranesic
>>On Feb 14, 6:19 am, Ogi Vranesic wrote: >> Hi all >> >> I read the very good tutorial onhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/ >> and understood that the admin interface has the ability to edit models on the >> same page as a parent model and these are called inlines. For two

Re: InlineModelAdmin related items on two levels

2010-02-13 Thread Matt Schinckel
Oh, and it is not flawless, there were still some issues I didn't get sorted out. I had some validation errors of some sort, I think, when updating data under certain circumstances, but I never quite completely tracked it down. -- You received this message because you are subscribed to the Google

Re: InlineModelAdmin related items on two levels

2010-02-13 Thread Matt Schinckel
On Feb 14, 6:19 am, Ogi Vranesic wrote: > Hi all > > I read the very good tutorial > onhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/ > and understood that the admin interface has the ability to edit models on the > same page as a parent model and these are called inlines. For two relate

InlineModelAdmin related items on two levels

2010-02-13 Thread Ogi Vranesic
Hi all I read the very good tutorial on http://docs.djangoproject.com/en/dev/ref/contrib/admin/ and understood that the admin interface has the ability to edit models on the same page as a parent model and these are called inlines. For two related models is this easy: class A (models.Model):

Re: 'Reverse' (??) InlineModelAdmin objects

2010-01-30 Thread Alexey
n key) field without any additional action). On Jan 30, 5:49 am, Rishabh Manocha wrote: > Hey guys, > I've been trying to get InlineModelAdmin objects setup in my admin > app, but am unable to figure out how to do so correctly. Using the > same example as the one listed in the docs

'Reverse' (??) InlineModelAdmin objects

2010-01-29 Thread Rishabh Manocha
Hey guys, I've been trying to get InlineModelAdmin objects setup in my admin app, but am unable to figure out how to do so correctly. Using the same example as the one listed in the docs [1]: class Author(models.Model): name = models.CharField(max_length=100) class Book(models.

Re: Making InlineModelAdmin objects required.

2010-01-21 Thread iliveinapark
ff/wiki/WadOfStuffDjangoForms > as the RequireOneFormSet class may give you some hints on how to do > this. > > regards > > Matthew > > On Jan 21, 3:57 pm, iliveinapark > wrote: > > > > > Hi all, > > > I'm wondering if there's a way

Re: Making InlineModelAdmin objects required.

2010-01-20 Thread mattimust...@gmail.com
Hi, Take a look at http://code.google.com/p/wadofstuff/wiki/WadOfStuffDjangoForms as the RequireOneFormSet class may give you some hints on how to do this. regards Matthew On Jan 21, 3:57 pm, iliveinapark wrote: > Hi all, > > I'm wondering if there's a way to make Inlin

Making InlineModelAdmin objects required.

2010-01-20 Thread iliveinapark
Hi all, I'm wondering if there's a way to make InlineModelAdmin objects required, so that if a user saves on an admin page without completing the fields of the inline model, it displays big red "This field is required." Errors like it does with the included fields. Cheers. -

Re: How do I filter an InlineModelAdmin ForeignKey?

2009-12-16 Thread Eric Chamberlain
Thank you. The code fixed my problem. On Dec 16, 2009, at 1:48 PM, Tim Valenta wrote: > Well, you're probably getting the error on your 'extra' inlines. > self.instance is unbound in that case, and so self.instance.providers > cannot be looked up. > > I wrote a little thing to fetch a proper o

Re: How do I filter an InlineModelAdmin ForeignKey?

2009-12-16 Thread Tim Valenta
Well, you're probably getting the error on your 'extra' inlines. self.instance is unbound in that case, and so self.instance.providers cannot be looked up. I wrote a little thing to fetch a proper object though... just be sure to include your parent model's field in your fields on the inline. Then

How do I filter an InlineModelAdmin ForeignKey?

2009-12-16 Thread Eric Chamberlain
I'd like PartnerRegistration's default_provider field to be filtered in PartnerRegistrationInline, like how Partner's default_provider field is filtered in PartnerAdmin. When I try the code below, I get a DoesNotExist exception in: self.fields['default_provider'].queryset = self.instan

Fwd: InlineModelAdmin paging

2009-11-02 Thread Jay Coulter
Hi all, Django documentation states that the inlines inherit same functionality as modeladmin so I want to enable paging on an inline but it doesn’t appear to work. This is the code for my inline, is the syntax incorrect?? class CustomerCardsInline(admin.TabularInline): mo

InlineModelAdmin

2009-09-30 Thread Marek Pietrucha
Hello, Could someone help me how can i add inlines to a admin.StackedInline? On the django web page it is written that: "The InlineModelAdmin class is a subclass of ModelAdmin so it inherits all the same functionality as well as some of its own: (...)" But when i add &quo

Re: How to use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-16 Thread Christopher Dodd
I can almost see how forms.models.inlineformset_factory could be tweaked to follow ManyToMany relationships to create inline formsets, perhaps with a parameter telling it which ManyToMany field to use. Am I barking up the wrong tree? Are these questions better off in the developer's group? On Ap

Re: How to use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-10 Thread Christopher Dodd
I realized my question was just a bit off. What I really want is to create a TabularInline to edit the members relationship on the Group interface. This is what you get when you use an intermediary model, as well as the ability to edit the other members of that model. I could, of course, create

How to use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-09 Thread Christopher Dodd
InlineModelAdmin needs a model that has foreign keys that define the relationship. Since the relationship is kept in a table that has no (explicit) model, I'm not sure how to do this. I've got it working in the cases where I use an Intermediary model, but am stumped in the cases whe

Re: InlineModelAdmin objects question

2009-02-25 Thread Kevin Audleman
4, 5:12 pm, Kevin Coyner wrote: > I am using the Auth system in django and have a separate app People > that I'm using to keep more detailed info (i.e. address, phone, etc) > on my users. I presume from my docs reading that this is the best way. > > Question:   Can I use InlineModel

Re: InlineModelAdmin objects question

2009-02-25 Thread Jamie Richard Wilson
t; on my users. I presume from my docs reading that this is the best way. > > Question: Can I use InlineModelAdmin to handle new user input from > just onepage, preferably my People admin page? > > > Here's what I've tried in people/admin.py: &

InlineModelAdmin objects question

2009-02-24 Thread Kevin Coyner
I am using the Auth system in django and have a separate app People that I'm using to keep more detailed info (i.e. address, phone, etc) on my users. I presume from my docs reading that this is the best way. Question: Can I use InlineModelAdmin to handle new user input from just on

Customize the InlineModelAdmin forms conditionally

2009-02-06 Thread George Sakkis
I'm trying to customize the admin interface so that each inline form for a given InlineModelAdmin is displayed differently, based on the instance to be edited in the form. For example, one may want to display each BookInline form under the AuthorAdmin with a different background color, bas

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 11:36 AM, Benjamin Buch wrote: > I simplified the models a bit for better demonstration. > Thanks. That makes it easier to spot the problem. > Here's the model: > > from django.db import models > > class a(models.Model): > title = models.CharField(max_length=50) >

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Benjamin Buch
All right, I think I've got it: 1: I tried to use InlineModelAdmin with a ManyToMany-Field. You can do this, but you've got to do it as described here I guess: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-many-to-many-intermediary-models . 2: I confused the m

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Benjamin Buch
I simplified the models a bit for better demonstration. Here's the model: from django.db import models class a(models.Model): title = models.CharField(max_length=50) other_model = models.ManyToManyField('b') def __unicode__(self): return self.title class b(models.Model):

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 10:53 AM, Benjamin Buch wrote: > > Hi, > > I'm trying to use InlineModelAdmins, but get a strange error thrown... > You get this error raised when you do what, exactly? Also the full traceback might provide a clue of what is going on. Karen --~--~-~--~~

Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Benjamin Buch
Hi, I'm trying to use InlineModelAdmins, but get a strange error thrown... Here's admin.py: from mysite.showroom.models import Project, ProjectImage, Client, Service from django.contrib import admin from filebrowser import fb_settings class ProjectImageInline(admin.TabularInline): model

InlineModelAdmin - Tagging

2008-11-14 Thread Mario
Hello, I would like to incorporate an InlineModelAdmin to an existing model with the django.tagging. How would I implement this functionality to an existing model? # models.py from django.db import models from tagging.fields import TagField from tagging.models import Tag class Post

InlineModelAdmin dynamic extra option

2008-09-04 Thread anonymous
Hi, I'ld like to put an "add another" kind of button at the admin inline form, but with InlineModelAdmin classes I can only put extra, min_num and max_nun. How could I do to add another instance dynamically without saving? Th

Re: InlineModelAdmin min_num ?

2008-08-21 Thread mike
8, at 9:24 PM, mike wrote: > > > InlineModelAdmin has max_num , shouldn't it have a min_num or am I > > missing something? > > > Thanks, > > -Mike > > -- > Peter of the Norse --~--~-~--~~~---~--~~ You received this message because y

Re: InlineModelAdmin min_num ?

2008-08-18 Thread Peter of the Norse
Perhaps you’re thinking of `extra`? On Aug 13, 2008, at 9:24 PM, mike wrote: > InlineModelAdmin has max_num , shouldn't it have a min_num or am I > missing something? > > Thanks, > -Mike -- Peter of the Norse --~--~-~--~~~---~--~~ You r