1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Accounts app improvements and tests

This commit is contained in:
Real-Gecko 2020-10-14 14:37:46 +06:00 committed by catborise
parent 8afef36656
commit 5172a9f619
20 changed files with 622 additions and 227 deletions

View file

@ -1,9 +1,7 @@
from django.conf import settings
from django.contrib.auth.models import User
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
from instances.models import Instance
@ -11,6 +9,7 @@ class UserInstanceManager(models.Manager):
def get_queryset(self):
return super().get_queryset().select_related('instance', 'user')
class UserInstance(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
instance = models.ForeignKey(Instance, on_delete=models.CASCADE)