Jonathan Richards Jonathan Richards - 1 year ago 38
Python Question

Finding Django source code based on import

I found a package extending the

in Django and I'm running into a bug with it, so I'm trying to look at the
's source code. Unfortunately the package imports
from django.db import models
and then calls
, but if I go to, all /django/db/models is a folder, not a file, and I can't find BigIntegerField anywhere. Is there any way to actually figure out where stuff is in the source code?

Answer Source

You can search github repo, for example for a class definition.

When importing models Python looks for a file named or for a models/ file if models is a directory. The latter file has a from django.db.models.fields import * line which import the BigIntegerField