Reputation: 527
I'm working with Aldryn NewsBlog and Aldryn Categories apps in DjangoCMS and want to add a Category Image field to the Category model and I'm getting confused as to how to make the field show up in the admin panel. All the SO articles I'm finding are on modifying the User or Page model, but that's not what I'm doing.
Here's what I have so far:
models.py
from filer.fields.file import FilerFileField
from aldryn_categories.models import Category
class CategoryExtension(Category):
image = FilerFileField()
admin.py
class CategoryImageAdmin(admin.ModelAdmin):
pass
I can't find clear instructions on how to add this additional field to the Category form in admin to allow users to select an image. I was able to create the field just fine I think. I added the models.py code and it made migrations without error. But I'm just struggling to comprehend how to add this field to the existing fields for Categories.
Upvotes: 1
Views: 297
Reputation: 12859
If you want to modify third party apps it's usually easiest to take a copy of them & add them to your project. Then you can modify them to do what you want. In this case, you can add the field to the model & create the migrations.
You can also monkey patch functions/classes if you just want to make minor changes. You can read about that here; What is monkey patching?
Upvotes: 0