15π
I understand now. For some reason the official documentation didnβt click with me, however reading this did:
http://django-suit.readthedocs.org/en/latest/sortables.html
To sum things up:
list_display
β is for which fields will appear in the admin page
list_editable
β is for which fields can be edited without officially opening them up in the βeditβ page. you can basically just edit them right there on the spot in-line. pretty awesome.
list_display_links
β at least one item from list_display
must serve as the link to the edit page. this item canβt also be in list_editable
otherwise it couldnβt serve as a link. (facepalm)
This is how I ended up modifying my files:
models.py
class Slider(models.Model):
...
link = "Edit"
...
admin.py
class SliderAdmin(admin.ModelAdmin):
...
list_display = (
'slider_title', 'slider_text', 'slider_order', 'link',)
list_display_links = ('link',)
list_editable = ('slider_title', 'slider_text', 'slider_order',)
...
- How to achieve authentication with django-auth-ldap?
- How to pass an url as parameter of include
- Django model_to_dict skips all DateTimeField when converting models
0π
You better create a dummy column in admin.py
as shown below instead of creating a dummy field in models.py
to make all columns editable in Django Admin:
class SliderAdmin(admin.ModelAdmin):
# ...
list_display = (
'slider_title', 'slider_text', 'slider_order', 'dummy',)
list_display_links = ('dummy',)
list_editable = ('slider_title', 'slider_text', 'slider_order',)
@admin.display(description="") # Here
def dummy(self, obj):
return ""
You can see my post expaining more details about it.
- Pinax error: no module named debug toolbar
- PASSWORD_HASHERS setting in Django
- What is the usage of `FilteredRelation()` objects in Django ORM (Django 2.X)?
- Avoid recursive save() when using celery to update Django model fields
- Django: AttributeError: 'NoneType' object has no attribute 'split'