*Cristian this was helpful and am really grateful!* *I'm also a python programmer and I'd like you to put me through Django. *
On Mon, 8 Feb 2021 at 14:56, Gabor Cristian <cristi26.ga...@gmail.com> wrote: > Hello, > > I am currently developing a system to block users from updating a form > data in case another user is also updating the same data at the same time. > > My application uses REST API's with DRF and I choose to use > django-rest-framework-condition > <https://github.com/jozo/django-rest-framework-condition> with the Etag > decorator in order to have an optimistic locking approach. > > What I understand is that the Etag is an identifier for a specific version > of a resource > > Let's say I have the following model > > class Blog(models.Model): > name = models.CharField(max_length=100) > tagline = models.TextField() > > So let's say in my view I want to return all entries from blog model > blog = Blog.objects.all() > > Doesn't that mean that the Etag function should consider the value in > blog variable when creating the identifier ? > > From what I see, the django condition function assigns value to res_etag > variable at the receiving of the HttpRequest before I can do any data query > from database. > > I do not quite understand how this can help me know if the entries from > Blog have been modified by another user. > > Could someone explain this mechanism ? > > Thanks, > Cristian > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/e1234384-0478-4b96-869b-2ebd4b63b0f9n%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/e1234384-0478-4b96-869b-2ebd4b63b0f9n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADWbU-gyiJpCcWnxsQ6ceGu86MVgJ5w0FvVw_nyYtng3fMKOSA%40mail.gmail.com.