Hello. I have a question about structuring my data within admin panel – I have on admin panel chapters like «Ratings», «Seats», which are not not arranged as logical blocks (don’t have logically coherent structure).
As example for «Seats» - seats_panel_1.jpg
For «Rating» - ratings_panel_1.jpg
So far, how can I arrange this data in the best possible way, so that they will be logically understandable and will be appropriate to business structure of my project?
#arranging the data in admin panel
48 messages · Page 1 of 1 (latest)
You will need to share the images via an image sharing site.
Allow me repost my query
Hello. I have a question about structuring my data within admin panel – I have on admin panel chapters like «Ratings», «Seats», which are not not arranged as logical blocks (don’t have logically coherent structure).
As example for «Seats» - https://1drv.ms/i/s!AhFknoAD2KhVkytljMI3iFK0XeFz?e=2yUqBj
For «Rating» - https://1drv.ms/i/s!AhFknoAD2KhVkypa8qxAti3csJ1v?e=dTm7AN
So far, how can I arrange this data in the best possible way, so that they will be logically understandable and will be appropriate to business structure of my project?
So you are querying the order of the columns?
More about general arrangement of data
What does that mean? Each row is a row in the database the columns are ordered by the list_display attribute on the admin class
Logical structure of it
It's a table of data
Well, I mean it's sporadic, and from outside noone understands the purpose of data
Well yes, the admin is generally designed to be used by technical people working with the code base, not end users.
Seats are usually depicted like this:
You're not going to be able to get them more coherent in a standard table than "order by Row then Number"
I still have no clue what you're actually asking for.
The built-in Django admin can display basic tables of data, with add/edit/delete forms for each object.
Well, I mean is it possible and viable to use airplane as a list display feature for seat?
And then inside it I will have all info like seat 1 row 1, seat 2, row 1 etc.
But on title page - only airplane showed
You can override admin templates such as the "edit" template for an Airplane, if you wanted to display other information on that page.
It's DRF project, not Django
So why are you talking about the Django admin?
Because general principles the same but you suggested templates
Whic is related to Django templates
So you're not wanting to customise the Django admin?
You're just asking for general "is this layout a good idea for my own admin page I'm designing" ?
One moment
Very strange pitch in documentation abot Django admin
I can't even find how to override edit feature here
Are you expecting to completely customise the Django admin edit page?
Wait I thought this wasn't about the Django admin?
I was about admin
I am 🤏 close to locking this thread unless there is a clear understandable question
but when I said about the Django admin you told me you were using DRF and my response was irrelevant
Honestly, man, you make no sense in the vast majority of things you say.
Ok, I will try to make it simple
- On list display page of Seats I want to have airplane name in which such seats are present
On detailed page of each airplane I want to have info like seat 1, row 1, seat 2 row 1
Like this
So, now it's clear, and understandable
In the Django admin?
Yes
so why did you mention DRF
That's easy enough with list_display
This is easy if you're happy with it being editable, using Inlines
Even then you could probably make it ready only, using Inlines
So, Your advice is to use list display as airplane and.inline elemnt form detailed page?
I'm not sure it's "advice" per-se, my advice would be to build your own UI if you want it particularly different from what Django provides as a default for users familiar with the model structure and codebase. But a TabularInline would probably provide a basic implementation of what you're asking for: https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.TabularInline