Django and FeinCMS: a way to use the media library in other normal models?

I am using Django and FeinCMS for the project. I am currently using FeinCMS for all pages of the site. But I also have another separate model that handles a very simple stock for the site. This stock model has the usual fields (name, description, etc.), but I also want it to have photos.

Since FeinCMS already has a media library, I would like to technically use this to have photos with my stock model. I could just make a model and ManyToManyField, but I'm curious to know if I can use ManyToManyField with the FeinCMS media library?

I know that with FeinCMS you can use the element editor on any other model, but I'm not sure if this is the right way. If this is the only way to do this, then it should be.

Many thanks

+6
python django django-admin content-management-system feincms
source share
1 answer

Of course, nothing prevents you from adding ForeignKey or ManyToManyField to the MediaFile model to one of your own models. Please note that it will be difficult for you to limit media files to images only. Maybe limit_choices_to will help.

+1
source share

All Articles