jumpserver/apps/users/models.py

22 lines
470 B
Python
Raw Normal View History

2016-08-08 16:43:11 +00:00
from __future__ import unicode_literals
from django.db import models
2016-08-09 17:30:19 +00:00
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import Group as AbstractGroup
2016-08-08 16:43:11 +00:00
2016-08-09 17:30:19 +00:00
class Group(AbstractGroup):
comment = models.CharField(max_length=80, blank=True)
class User(AbstractUser):
groups = models.ManyToManyField(Group)
@property
def name(self):
return self.first_name + self.last_name
class Meta:
db_table = 'user'