I have a model in my app called photos
. Any user can upload photos. When uploaded at first, I store them in a temporary field names tempfile
. Then the admin can review them and approve them. If approved the approved
field will be true and the photo will be uploaded the s3. The photo will be saved in the file
field and the tempfile
will be removed. The submitted
field in the database will be set to true. If the upload fail, it will be marked in the database. If the photo is rejected, the user can resubmit them.
- So, in the normal view i need to show
approved
and nonfailed uploads
- If a user edit a photo it should be
unapproved
andsubmit
until the admin approve them - In the resubmit menu I have to show
unapproved
,unsubmitted
photos - If user resubmit, the submit field will be set to true
By the looks of it I have to use a lot of database fields and it gets complex. Is there a way to handle this better? A way to save draft and save unapproved separately? How to do this effectively?
PS : This is a bit different and complex scenario than the one I posted earlier. A different app with more complex needs than just a simple draft.