gva/gnuviechadmin/osusers/models.py
2014-05-24 21:28:33 +02:00

31 lines
1.3 KiB
Python

from django.db import models
from model_utils.models import TimeStampedModel
class Group(TimeStampedModel, models.Model):
groupname = models.CharField(max_length=16, unique=True)
gid = models.PositiveSmallIntegerField(unique=True, primary_key=True)
descr = models.TextField(blank=True)
passwd = models.CharField(max_length=128, blank=True)
class User(TimeStampedModel, models.Model):
username = models.CharField(max_length=64, unique=True)
uid = models.PositiveSmallIntegerField(unique=True, primary_key=True)
group = models.ForeignKey(Group)
gecos = models.CharField(max_length=128, blank=True)
homedir = models.CharField(max_length=256)
shell = models.CharField(max_length=64)
class Shadow(TimeStampedModel, models.Model):
user = models.OneToOneField(User, primary_key=True)
passwd = models.CharField(max_length=128)
changedays = models.PositiveSmallIntegerField(blank=True, null=True)
minage = models.PositiveSmallIntegerField(blank=True, null=True)
maxage = models.PositiveSmallIntegerField(blank=True, null=True)
gracedays = models.PositiveSmallIntegerField(blank=True, null=True)
inactdays = models.PositiveSmallIntegerField(blank=True, null=True)
expiredays = models.PositiveSmallIntegerField(blank=True, null=True,
default=None)