>
>
> I would like to know if it is possible to retrieve *models*.mymodel
> instance from outside the models.py to retrieve a queryset.
>

Yes, a vast majority of the time you'll be retrieving instances from your
views and templates. There are only a few cases where you would retrieve
instances within models.py.


> I want to make a selection in a specific model but I am not inside the
> model.
>

In almost all cases you will NOT be inside of the code for the model when
pulling instances from the database.


> I need to perform some update in my action  model but the information is
> in another entity.
>
> I tryed to use Manager (mymodel = models.Manager() but I havn't found any
> function to get an specific queryset from Manager.
>
> Could someone help me with this issue?
>

Without the specific code you are using, I can't comment on what issue you
are having, however, the one line you provided doesn't appear to follow the
convention if you are replacing the default model manager. More information
can be found here:


https://docs.djangoproject.com/en/2.2/topics/db/managers/#custom-managers


However, given the other questions you are asking, I doubt you have need
for a custom model manager at this stage. I have a feeling you are
implementing it simply to address other built-in functionality you want
that you may not be aware of how to access. I could be wrong, though.

I'd recommend running through the official tutorial, as that covers the
information to answer your questions and broaden your understanding in some
detail.


https://docs.djangoproject.com/en/2.2/intro/tutorial01/



-James

-- 
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/CA%2Be%2BciUZRkfJ2YsjfwRZncgSkarOU2EeJ9%3D6QHp6X77FmRtePQ%40mail.gmail.com.

Reply via email to