Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Django Abstract base classe

from django.db import models

class CommonInfo(models.Model):
    name = models.CharField(max_length=100)
    age = models.PositiveIntegerField()

    class Meta:
        abstract = True

class Student(CommonInfo):
    home_group = models.CharField(max_length=5)
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #Django #Abstract #base #classe
ADD COMMENT
Topic
Name
2+4 =