Questions tagged [django-admin]

Django's built-in, automatic admin interface (django.contrib.admin) which is part of the Django Web framework for the Python programming language.

One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin’s recommended use is limited to an organization’s internal management tool. It’s not intended for building your entire front end around.

-- Django Admin Documentation

Resources:

10185 questions
4
votes
3 answers

Django call 'id' expected a number but got string

Django errors with django-import-export libraries. I want to import data from excel to db via django admin. I use for it django-import-export, but i got Field 'id' expected a number but got 'HPI'. Excel file contains I found answer, that I have…
Bogdan
  • 99
  • 1
  • 10
4
votes
3 answers

Django admin StackedInline in custom tab

I currently having problem trying to figure out how can i put 3 inline in a single tab on the change view. I currently have the following admin for one of the view as follow: class UserAdminCustom(admin.ModelAdmin): list_display = ('id',…
Linh Nguyen
  • 3,452
  • 4
  • 23
  • 67
4
votes
0 answers

String Representation of Model for StackedInlineAdmin in Django Admin

Is there any way to change the string representation of the model just for single StackedInlineAdmin? Like currently it shows: for __str__ def __str__(self): """ Return string representation of ApplicationFrom objects. :return: str …
Tayyab Razzaq
  • 461
  • 3
  • 11
4
votes
2 answers

Django Admin encrypt values of certain fields on changed(or save) with save_model()

I currently having a custom User model which some of the fields are supposed to be encrypted (data side) but on Django Admin they need to be decrypted to show the actual data so i have encrypt_string() and decrypt_string() function to handle it. My…
Linh Nguyen
  • 3,452
  • 4
  • 23
  • 67
4
votes
1 answer

Django change the order of pre_save post_save signals being called when using inlines?

I have an Order (1) and OrderLine (n) model, here order can have multiple order-lines. This is all run from inside the Django-admin, where the OrderLine is setup as part of the inlines on OrderAdmin(admin.ModelAdmin). Simplified like this: class…
Roger
  • 7,535
  • 5
  • 41
  • 63
4
votes
1 answer

Redirect to the filtered list in Django Admin

Suppose, I have a modelA and modelB, that has ForeignKey relationship with modelA On the any modelA object page in Django Admin, I would like to have a link to the filtered list of modelB instances that have the relationship with that modelA…
Anil Panda
  • 375
  • 1
  • 3
  • 14
4
votes
1 answer

django-admin.py dumpdata to SQL statements

I'm trying to dump my data to SQL statements. the django-admin.py dumpdata provides only json,xml,yaml. so: does someone know a good way to do it?! I tried that: def sqldumper(model): result = "" units = model.objects.all().values() for unit in…
nivniv
  • 3,421
  • 5
  • 33
  • 40
4
votes
2 answers

Django admin site change_list view customization

I have a ModelAdmin subclass for my gradeScalesSettings model: @admin.register(gradeScalesSetting) class gradeScalesSettingAdmin(admin.ModelAdmin): list_display = ('configuration_select', 'NumberOfGrades', 'Rounding','Precision', 'Status',) …
user12295267
4
votes
2 answers

Django Admin intercept onchange event of a field and make an action

In my django project i would clear a field value every time another select field have an onChange event. I have an add form like thisone: every time Template field change (onChange), Test Case field have to become blank. How can i do this in a…
Manuel Santi
  • 1,106
  • 17
  • 46
4
votes
3 answers

Django Admin - RelatedObjectLookups - How Does it refresh and set the select on the parent window?

I want one of my forms to work just like the admin page does so I figured I'd look in the code and see how it works. Specifically I want the user to be able to click a "+" icon next to a select list and be taken to the admin page's popup form to add…
Greg
  • 45,306
  • 89
  • 231
  • 297
4
votes
1 answer

Django 2 upgrade lost filter_horizontal functionality

I recently upgraded to Django 2.2.2 and Python 3.6.8, and my filter_horizontal feature in Django admin has disappeared. I tried viewing my admin in Chrome incognito mode, as some answers suggest, and I also tried changing verbose_name strings to…
wraasch
  • 405
  • 3
  • 13
4
votes
2 answers

How do you reference related models' fields in the admin list_filter?

My Models: OrderInfo is one-to-one with Print, which is a Many-to-One with Painting, which itself is a Many-to-One with Club. class OrderInfo(models.Model): print_ordered = models.OneToOneField(Print, blank=True) class Print(models.Model): …
spencewah
  • 2,196
  • 4
  • 20
  • 31
4
votes
1 answer

Wagtail - Revisions for Non-Page Objects

I use vanilla django models (they do not inherit from Page) and the modeladmin module of wagtail to replace the standard django admin with the wagtail admin interface. This is all working great, but I now wish to add revision history and rollback to…
MrName
  • 2,363
  • 17
  • 31
4
votes
2 answers

Django admin - adding a field to displayed user list

In the Django admin screen for displaying lists of users (with the header, Select user to change), there are the fields username/email, etc and staff_status. I would like to add the user's active status to that display. Although most of the…
John C
  • 6,285
  • 12
  • 45
  • 69
4
votes
1 answer

Django Admin - Upload multiple images to multiple model objects in a single upload

I have a model that has close to 150K entries in the Database. Today, it's possible to upload an image for each entry separately, when editing that specific entry. We have a need to upload close to 4k image files, one for each entry, and I would…
Meny Issakov
  • 1,400
  • 1
  • 14
  • 30
1 2 3
99
100