Opened 9 years ago

Last modified 9 years ago

#25202 closed Cleanup/optimization

Referencing the User model missing parenthesis — at Version 1

Reported by: Jeff Schulthies Owned by: nobody
Component: Documentation Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Baptiste Mispelon)

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#referencing-the-user-model

Referencing the User model. The example is missing a parenthesis.

from django.conf import settings
from django.db import models

class Article(models.Model):
    author = models.ForeignKey 
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
    )

Corrected:

from django.conf import settings
from django.db import models

class Article(models.Model):
    author = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
    )

Change History (1)

comment:1 by Baptiste Mispelon, 9 years ago

Description: modified (diff)
Easy pickings: set
Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top