Latest version synced: Plat/al 1.1.15
https://github.com/Polytechnique-org/platal/tree/xorg/maint/upgrade
+cf. https://docs.djangoproject.com/en/dev/howto/legacy-databases/
+
This requires Django to work.
"""
from __future__ import unicode_literals
+
import collections
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Skin(models.Model):
- #id = models.IntegerField(primary_key=True)
+ id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=96)
date = models.DateField()
comment = models.CharField(max_length=765)
auteur = models.CharField(max_length=90)
skin_tpl = models.CharField(max_length=96)
ext = models.CharField(max_length=9)
+
class Meta:
db_table = 'skins'
@python_2_unicode_compatible
class EmailVirtualDomain(models.Model):
- #id = models.IntegerField(primary_key=True)
+ id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=765)
aliasing = models.ForeignKey('self', db_column='aliasing')
+
class Meta:
db_table = 'email_virtual_domains'
@python_2_unicode_compatible
class ProfileSectionEnum(models.Model):
- #id = models.IntegerField(primary_key=True)
+ id = models.IntegerField(primary_key=True)
text = models.CharField(max_length=150, unique=True)
+
class Meta:
db_table = 'profile_section_enum'
licenseplate = models.CharField(max_length=12, db_column='licensePlate', blank=True) # Field name made lowercase.
belongsto = models.ForeignKey('self', null=True, db_column='belongsTo', blank=True) # Field name made lowercase.
countryplain = models.CharField(max_length=765, db_column='countryPlain', blank=True) # Field name made lowercase.
+
class Meta:
db_table = 'geoloc_countries'
type = models.CharField(max_length=48, primary_key=True)
perms = models.CharField(max_length=321)
description = models.TextField(blank=True)
+
class Meta:
db_table = 'account_types'
best_domain = models.ForeignKey(EmailVirtualDomain, null=True, db_column='best_domain', blank=True)
from_email = models.CharField(max_length=765)
from_format = models.CharField(max_length=12)
+
class Meta:
db_table = 'accounts'
class AccountProfile(models.Model):
account = models.ForeignKey(Account, db_column='uid', related_name='profiles')
profile = models.ForeignKey(Profile, db_column='pid', related_name='accounts')
- pkey = models.CompositeField(account, profile, primary_key=True)
perms = models.CharField(max_length=15)
+
class Meta:
db_table = 'account_profiles'
+ unique_together = (('uid', 'pid'),)
def __str__(self):
return '%s -> %s' % (self.account.hruid, self.profile.hrpid)
#id = models.IntegerField(primary_key=True)
account = models.ForeignKey(Account, unique=True, null=True, db_column='uid', blank=True)
url = models.CharField(max_length=255, unique=True)
+
class Meta:
db_table = 'account_auth_openid'
certificat = models.CharField(max_length=96, primary_key=True)
account = models.ForeignKey(Account, null=True, db_column='uid', blank=True)
created = models.DateTimeField(null=True, blank=True)
+
class Meta:
db_table = 'account_lost_passwords'
account = models.ForeignKey(Account, primary_key=True, db_column='uid')
date = models.DateTimeField(null=True, blank=True)
hash = models.CharField(max_length=96)
+
class Meta:
db_table = 'account_xnet_lost_passwords'
flags = models.CharField(max_length=87)
noinvite = models.IntegerField()
post_id = models.IntegerField(null=True, blank=True, editable=False,
- help_text=u"NNTP post identifier")
+ help_text="NNTP post identifier")
+
class Meta:
db_table = 'announces'
attach = models.TextField()
x = models.IntegerField()
y = models.IntegerField()
+
class Meta:
db_table = 'announce_photos'
class AnnounceRead(models.Model):
evt = models.ForeignKey(Announce)
account = models.ForeignKey(Account, db_column='uid')
- pkey = models.CompositeField(evt, account, primary_key=True)
+
class Meta:
db_table = 'announce_read'
+ unique_together = (('evt', 'uid'),)
def __str__(self):
return "%s: %s" % (self.account, self.evt)
class EmailVirtual(models.Model):
email = models.CharField(max_length=255)
domain = models.ForeignKey(EmailVirtualDomain, db_column='domain')
- pkey = models.CompositeField(email, domain, primary_key=True)
redirect = models.CharField(max_length=765)
type = models.CharField(max_length=21, blank=True)
expire = models.DateField()
+
class Meta:
db_table = 'email_virtual'
+ unique_together = (('email', 'domain'),)
def __str__(self):
return "%s@%s (%s)" % (self.email, self.domain, self.type)
class EmailRedirectAccount(models.Model):
account = models.ForeignKey(Account, db_column='uid')
redirect = models.CharField(max_length=765)
- pkey = models.CompositeField(account, redirect, primary_key=True)
rewrite = models.CharField(max_length=765)
type = models.CharField(max_length=30)
action = models.CharField(max_length=54)
flags = models.CharField(max_length=24)
hash = models.CharField(max_length=96, blank=True)
allow_rewrite = models.BooleanField()
+
class Meta:
db_table = 'email_redirect_account'
+ unique_together = (('uid', 'redirect'),)
def __str__(self):
return "%s for %s (%s)" % (self.redirect, self.account.hruid, self.type)