Re: Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread James Beith
wrote: > > On 1 September 2016 at 11:55, James Beith > > wrote: > > By using a model name there are fewer imports at the top of the module > and > > fewer occurrences of circular import dependencies between Django > > applications. What are the disadvantage

Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread James Beith
A ForeignKey field is often defined using the class to which the model is related, for example. from django.db import models from authors.models import Author class Post(models.Model): author = models.ForeignKey(Author) Alternatively the model name can be used, rather than the model class