dman926 / SEPHIRA-CMS

An Angular 13 front end with a complete FastAPI backend. Perfect for getting your next project off the ground
MIT License
9 stars 6 forks source link

Post status #12

Open dman926 opened 3 years ago

dman926 commented 3 years ago

Is your feature request related to a problem? Please describe. Posts have a status field that determines if they are published, draft, private, deactivated. The field doesn't do anything as of now.

Describe the solution you'd like Post status works similar to WordPress. Published posts are available to everyone. Don't really know what drafts can do, can probably be removed. Private is only available to admins. Deactivated are deactivated (some posts shouldn't be deleted as they are referenced elsewhere such as Product). Just need to add the code to utilize the post status field when retrieving posts. It might also be good to make slugs unique with _cls and status so that deactivated posts don't interfere with others, unless that brings in other design hindrances.

dman926 commented 2 years ago

_cls can probably be ignored. Doesn't matter anymore as Post is abstract and makes a separate collection for each post type. Do need to try out making child-child post types. I think there's a mongo engine option to make inherited (not abstract) documents be in their own collection.

EDIT: You should be able to define a separate collection using the meta key 'collection': '<COLLECTION NAME>'. Will need to try it out if it works with inheritance, or if an mediary abstract should be used instead.