Browse Source

added UNIQUE constraints

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
73bda3ca3b
  1. 5
      pyweb/mumble/models.py

5
pyweb/mumble/models.py

@ -48,6 +48,9 @@ class Mumble( models.Model ):
defchan= models.IntegerField( 'Default channel', default=0 ); defchan= models.IntegerField( 'Default channel', default=0 );
booted = models.BooleanField( 'Boot Server', default = True ); booted = models.BooleanField( 'Boot Server', default = True );
class Meta:
unique_together = ( ( 'dbus', 'srvid' ), ( 'addr', 'port' ), );
def __init__( self, *args, **kwargs ): def __init__( self, *args, **kwargs ):
models.Model.__init__( self, *args, **kwargs ); models.Model.__init__( self, *args, **kwargs );
self._ctl = None; self._ctl = None;
@ -230,6 +233,8 @@ class MumbleUser( models.Model ):
owner = models.ForeignKey( User, null=True, blank=True ); owner = models.ForeignKey( User, null=True, blank=True );
isAdmin = models.BooleanField( 'Admin on root channel', default = False ); isAdmin = models.BooleanField( 'Admin on root channel', default = False );
class Meta:
unique_together = ( ( 'server', 'owner' ), );
is_server = False; is_server = False;
is_channel = False; is_channel = False;

Loading…
Cancel
Save