eager DB fetching of nested objects

2019-11-26 Thread Elico
Hi, I would like to query an object from a DB and fetch all nested objects. For example: class ModelA(models.Model): ... class ModelB(models.Model): a = models.ForeignKey(ModelA) ... class ModelC(models.Model): b = models.ForeignKey(ModelB) ... I want to query C by it's ID

Re: Question

2019-11-26 Thread Elico
Hi Kennedy, What is Mysite.py? You should run $ python manage.py runserver You run this from the directory where manage.py is located. On Tue 26. Nov 2019 at 20:47, kennedy musyoki wrote: > I am new in Django and programming as well, I am to run the following code > in cd but getting the erro

Re: extending a custom user (AbstractBaseUser) and displaying in admin

2019-11-24 Thread Elico
Hi Motaz, Thank you for your response. I didn’t try that yet, however my assumption is that I would have duplicates of fields inherited from the User class. On Sun 24. Nov 2019 at 11:16, Motaz Hejaze wrote: > One way around is to make the models Employee and Company to inheret from > User in