Django API specifications and dot notation -
is there tree django dot notation can navigate , discover options dot operator of sub class?
for example can have
models.foreignkey
models.datetime
models.charfield
etc. etc.
but options? know have inheritance (i.e., check example in parent classes django.db.models ) wondering if aware of place info gathered in 1 place ( example java http://docs.oracle.com/javase/7/docs/api/
)
that's not django, that's python. dot-notation used object paths, not inheritance. did this:
from django.db import models
this python instruction, telling interpreter locate module django.db
, lookup models
in , make available in current context. happens specific item submodule. possible because in python modules actual objects (some kind of singletons).
what want know what's inside module. if so, may either @ django's fields documentation or list content of module in python shell, using dir(models)
(will return lots of useless stuff).
by way, equivalent:
from django.db import models foo = models.charfield(max_length=42) bar = models.integerfield() django.db.models import charfield, integerfield foo = charfield(max_length=42) bar = integerfield()
Comments
Post a Comment