Description. There's a print-friendly file for you to download and view, if you want to read it on a screen. Reading this file is as easy as 1-2-3.# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-07-30 02:47
from __future__ import unicode_literals
import django.contrib.auth.models
class VerkCompositeKey(django.contrib.auth.models.User):
"""
Base User with composite foreign key.
.. versionadded:: 1.4
site = models.ForeignKey(
"VerkCompositeKey",
related_name="%(app_label)s_%(class)s_related",
on_delete=django.contrib.auth.models.CASCADE,
)
class Meta:
abstract = True
class CustomCompositeKey(VerkCompositeKey):
unique_together = [
("site", "user_id"),
("site", "site"),
]
def __str__(self):
return self.site.site_name
class User(CustomCompositeKey):
Base User.
ordering = ("-site", "last_login")
get_latest_by = "last_login"
last_login = models.DateTimeField(null=True, verbose_name="last login")
def __
Related links:
Comments