I'm a Django and DB noob, but I'm working on a website that has both blogs and articles. They are instantiated in admin in their own respective fields and basically I have a class "FeaturedPost
" in model.py where for one of the attributes "content" I want to be able to pick from the available blogs or articles.
I'm aware that if I want to map the content to a blog, I would do a
models.ForeignKey(Blogs, related_name="w/e")
but how do I abstract this so I can pick from the two content types? Would a GenericForeignKey
be helpful?
I'm using Fein-CMS if that helps with anything in this case.