#26069: Docs for MyModel._meta.get_fields_with_model() missing info about
'is_relation'
----------------------------------------------+--------------------
     Reporter:  srkunze                       |      Owner:  nobody
         Type:  Uncategorized                 |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.8
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 https://docs.djangoproject.com/en/1.9/ref/models/meta/#migrating-old-meta-
 api

 Docs use source code a explanation:

 {{{
 MyModel._meta.get_fields_with_model():

 [
     (f, f.model if f.model != MyModel else None)
     for f in MyModel._meta.get_fields()
     if not f.is_relation
         or f.one_to_one
         or (f.many_to_one and f.related_model)
 ]
 }}}

 1) Why does {{{ get_fields_with_model }}} return fields with {{{not
 is_relation}}}?

 2) When does a {{{many_to_one}}} field not have a {{{related_model}}}?

 3) Is it possible to have a {{{one_to_one}}} field with no
 {{{related_model}}}?

--
Ticket URL: <https://code.djangoproject.com/ticket/26069>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.22df7c3de44f959c16756c6742d62a47%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to