Discussion:
How to get queryset from get method
(too old to reply)
Thiago Luiz Parolin
2018-12-04 12:39:16 UTC
Permalink
I have a class (Updateview) to handle file upload for a particular model.
In this class, I do some validation on the get method that uses a queryset.
In get_object and get_context_data I need to do the same query used in the
get method, how can I reuse the get method's queryset in another method of
the same class?
I do not know if I could explain it correctly, but thanks if anyone can
help me.
--
Thiago Luiz Parolin
--
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+***@googlegroups.com.
To post to this group, send email to django-***@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/CANbmKyvFhCuyDjENxn8YxBJz71rXK3AH%2Bh9W16EuNnBhRVRLOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Gerson David Vizquel Alemán
2018-12-04 18:05:23 UTC
Permalink
Hello Thiago, review this link: http://ccbv.co.uk/
Post by Thiago Luiz Parolin
I have a class (Updateview) to handle file upload for a particular model.
In this class, I do some validation on the get method that uses a queryset.
In get_object and get_context_data I need to do the same query used in the
get method, how can I reuse the get method's queryset in another method of
the same class?
I do not know if I could explain it correctly, but thanks if anyone can
help me.
--
Thiago Luiz Parolin
--
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+***@googlegroups.com.
To post to this group, send email to django-***@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/d8b0fe72-63ed-4713-ad12-f807402eed1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thiago Luiz Parolin
2018-12-05 08:54:41 UTC
Permalink
Thanks!!
This site is awesome and will help me a lot
Post by Gerson David Vizquel Alemán
Hello Thiago, review this link: http://ccbv.co.uk/
I have a class (Updateview) to handle file upload for a particular model. In this class, I do some validation on the get method that uses a queryset. In get_object and get_context_data I need to do the same query used in the get method, how can I reuse the get method's queryset in another method of the same class?
I do not know if I could explain it correctly, but thanks if anyone can help me.
--
Thiago Luiz Parolin
--
You received this message because you are subscribed to the Google Groups "Django users" group.
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/d8b0fe72-63ed-4713-ad12-f807402eed1d%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+***@googlegroups.com.
To post to this group, send email to django-***@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/CEBFE353-0C0C-464F-BB9B-A25CC47DEC93%40unesp.br.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...