Django and FeinCMS: A way to use the Media Library in other normal models?
Asked Answered
C

1

6

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

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

I know with FeinCMS you can use the item editor on any other model, but I'm not sure that's the right way to go about it. If it's the only way to do this, then that will have to be it.

Many thanks

Cleotildeclepe answered 22/8, 2010 at 18:22 Comment(0)
O
1

Sure -- there's nothing stopping you from adding a ForeignKey or a ManyToManyField to the MediaFile model to one of your own models. Note that you'll have a hard time limiting the media files to only images. Maybe limit_choices_to will help though.

Onfre answered 23/9, 2010 at 10:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.