Wednesday, May 4, 2016

Re: Storing data before committing to data base, wait for approval of admin

I'd probably just keep a seperate table for all the edits, with a
foreign key pointing back to the record to be updated. Seems like the
simplest layout to me, unless there's some complicating factor I'm
overlooking.

It would have a field for each field that edits can be suggested for,
a foreign key pointing to the person who suggested the edit, and
perhaps a flag for approved, rejected, or pending. You might also
want to allow the data fields to be blankable and nullable, so you can
distinguish between a field where no edit was suggested, and one that
was suggested to be emptied, provided that there's a way for the user
to make that distinction in the user interface.

Not sure if this is what you were looking for or not.

Aaron

On 5/4/16, Mark <mark.p.pare@gmail.com> wrote:
>
>
> I'm building a mobile app using Ionic framework, so the front end is
> essentially a single page AngularJS app. I'm using Django Rest framework as
>
> the backend.
>
> In the application, an employee should be able to suggest updates, deletes,
>
> or additions to database models. In my schema, there is a "Contact person"
> model (which has fields like first_name, last_name, phone_number, etc.), a
> "GPS Address model" (which has fields like street_name, street_num, city,
> etc.) and an overarching "Delivery stop" model to which virtually all of
> the other models relate.
>
>
> What I need to implement is a system whereby an employee can suggest an
> edit to an existing object, say a Contact (id: 45, first_name: 'John',
> phone_number: "435-0000") which has a FK relationship to a Delivery Stop
> (id: 20, title: "Stop and Shop", notes: "closes at 0600"). The employee
> wants to update the phone number to "435-0001". But the update shouldn't be
>
> committed to the database until a manager has reviewed the update and
> approved, or edited the update then approved.
>
>
> I have a few ideas about how I might do this, but none of them seem as easy
>
> as I think it could be. Does anyone have any suggestions about best
> practices in this situation?
>
> The application will also include a special manager interface where they
> can few all suggested updates/edits and approve/reject them. The client
> side essentially functions with the Delivery Stop as the primary object,
> which shows all related items in a tabbed interface (Contacts, Gps
> addresses, etc.) And each time an edit is suggested by an employee, the
> appropriate manager will receive an email notification.
>
>
> Any suggestions are much appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99fecded-f6f7-4d3a-8876-44e83a3ce007%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAERFoOhMpe9knkOebze743cNFWs-X3GNH2kq9WV1jLJ50-FORA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment