Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django get_user_model() function

from turtle import title
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.db import models

# Create your models here.

class Post(models.Model):
    Title = models.CharField(max_length=200)
    Text = models.TextField()
    Author = get_user_model()
    Created_date = models.DateTimeField(max_digits=None, decimal_places=None)
    Published_date = models.DateTimeField(max_digits=None, decimal_places=None)
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django #function
ADD COMMENT
Topic
Name
9+9 =