Questions tagged [inlines]
55 questions
53
votes
4 answers
Django admin - inline inlines (or, three model editing at once)
I've got a set of models that look like this:
class Page(models.Model):
title = models.CharField(max_length=255)
class LinkSection(models.Model):
page = models.ForeignKey(Page)
title = models.CharField(max_length=255)
class…

The_OP
- 667
- 1
- 8
- 11
37
votes
10 answers
Data binding the TextBlock.Inlines
My WPF App receives a stream of messages from a backend service that I need to display in the UI. These messages vary widely and I want to have different visual layout (string formats, colors, Fonts, icons, whatever etc.) for each message.
I was…

will
- 3,975
- 6
- 33
- 48
17
votes
9 answers
Making inlines conditional in the Django admin
I have a model that I want staff to be able to edit up to the date for the event. Like this:
class ThingAdmin(admin.ModelAdmin):
model = Thing
if obj.date < today: #Something like that
inlines = [MyInline,]
The problem is, I don't…

Jason Goldstein
- 1,117
- 2
- 11
- 20
15
votes
6 answers
Django admin different inlines for change and add view
I need separate views for add and change page. In add page I'd like to exclude some fields from inline formset. I've prepared two TabularInline classes, one of them contains property 'exclude'. I tried to use them as follows:
class…

alekwisnia
- 2,314
- 3
- 24
- 39
9
votes
1 answer
Django Inlines user permissions + view only - permissions issues
I'm not sure if this is a bug or I'm just missing something (although I have already parsed the documentation about inlines), but:
Let's say I have a model A. Model A is an inline of model B. User U has full access to model B, but only change…

Vali
- 93
- 1
- 5
6
votes
1 answer
Django Admin like Inlines in my ModelForm
I'm trying to replicate the inlines in the Django admin for adding related models on a FKd model on my own non admin ModelForm. In particular, when you use a StackeAdminInline and you get the "+ Add another XXX" bit of Javascript to add more of the…

Ludo
- 2,739
- 2
- 28
- 42
5
votes
2 answers
Django admin - how to save inlines?
I need to override save method of inlines in admin. While saving photos, I need to add user id to DB column. I cant make it in model because there is no request data there. How can I do it in admin, to somehow get nad set user id?

robos85
- 2,484
- 5
- 32
- 36
5
votes
3 answers
Highlight Search TextBlock
My goal is to create a custom TextBlock control that has a new dependency property, SearchText. This property will contain a regular expression. All occurrences of this regular expression in the text of the TextBlock will be highlighted using a…

Josh G
- 14,068
- 7
- 62
- 74
5
votes
2 answers
Django nested inline TemplateDoesNotExist
The Error
I'm trying to use the django-nested-inline package. It seems like everything works but when I try to create a new Course with the admin website I get the following error:
TemplateDoesNotExist at…
user3835277
4
votes
1 answer
django admin delete objects in inlines in save_model method
I have two related (via foreignkey relation) models and created admin model for parent with inlines. In several cases (edited in admin by boolean field), i need to delete all previous objects (inlines) and create new ones. I've tried to make it with…

sepulchered
- 814
- 7
- 18
4
votes
2 answers
Trying to inline a HyperLinkButton in a TextBlock
I'm adding Inlines to a TextBlock. The Run() inlines work. Of course the Hyperlink() is deprecated in Windows 8 (using Windows.UI.Xaml.Documents) for some reason, so I'm trying to encapsulate a HyperlinkButton in an InlineUIContainer using C#. I…

Ken Cone
- 460
- 1
- 4
- 11
3
votes
1 answer
Including fields from a OneToOneField in Django Admin
I am attempting to add the fields from a OneToOneField into my admin view. Here is an example of how my models look.
class Customer(BaseUser):
name = CharField()
address = CharField()
secondary_information =…

Jake Mulhern
- 660
- 5
- 13
3
votes
1 answer
Is it possible to embed a StackedInline in another StackedInline with Django?
I think the title is self-explanatory. I this possible with the actual django version ?
Thk in advance.

fokenrute
- 739
- 6
- 17
3
votes
1 answer
Add row to inlines dynamically in django admin
I have the following defined:
class AnswerChoiceInline(admin.TabularInline):
model = AnswerChoice
# extra = 0
class QuestionAdmin(admin.ModelAdmin):
inlines = [AnswerChoiceInline]
admin.site.register(Question,…

ashchristopher
- 25,143
- 18
- 48
- 49
3
votes
2 answers
Django ManyToMany Inlines Ordering in 1.2.x
I'm using Django 1.2's new ManyToMany admin.TabularInline to display related objects in the admin app, and it works great except I can't figure out what to set the "ordering" property to so it can sort by one of the cross-referenced field names.
For…

Jough Dempsey
- 663
- 8
- 22