4 ms·
My issues with the default admin are: 1)You can't add text to a page. I want to add information from another model. For example a field of a foreign key model.
by Siecje 13y ago
My issues with the default admin are:
1)You can't add text to a page. I want to add information from another model. For example a field of a foreign key model.
What I currently do is put that in the __unicode__ function, but it has no context as to what it is.
Then in the rest of my site(outside of admin) I use the values directly. print (model.name) instead of print (model)
2) You can't put display return values of model methods. You have to create property values. But property values are not query sets so you can't really use them, but don't realize that you need .filter until your site is super slow.
3) Inline form validation is magical. You can't just add validation to an inline form, you have to do this http://pastebin.com/CGjLX2vf http://pastebin.com/CGjLX2vf
4) You can't search in foreign key form fields. I have a M2M foreign key field and when I select I have to hold ctrl and scroll with this tiny scroll bar the size of my mouse cursor and I have hundreds of items in the field.
Please let me know if I am just doing it wrong.
- whubr 13y ago1. You can use custom admin templates (just override the necessary blocks) 2. Not sure what you mean :) 3. Yes, this is a little awkward 4. You need filter_horizontal or filter_vertical: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.filter_horizontal https://docs.djangoproject.com/en/dev/ref/contrib/admin/#dja...
- kmike84 13y agoYou can do (1) and (2) using readonly_fields (see https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields https://docs.djangoproject.com/en/dev/ref/contrib/admin/#dja... ). For (4) use raw_id_fields (https://github.com/lincolnloop/django-salmonella https://github.com/lincolnloop/django-salmonella app could be also helpful).
- whubr 13y agoSalmonella is awesome but doesn't play well with multiple admin sites.