Fixes on migrations

This commit is contained in:
Marc Aymerich 2015-04-29 13:55:22 +00:00
parent 950205631a
commit a6d6fd951b
31 changed files with 430 additions and 400 deletions

View File

@ -2,35 +2,35 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import django.contrib.auth.models
import django.core.validators import django.core.validators
import django.utils.timezone import django.utils.timezone
import django.contrib.auth.models
class Migration(migrations.Migration): class Migration(migrations.Migration):
# dependencies = [ # dependencies = [
# ('systemusers', '__first__'), # ('systemusers', '0001_initial'),
# ] # ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='Account', name='Account',
fields=[ fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
('password', models.CharField(max_length=128, verbose_name='password')), ('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(verbose_name='last login', blank=True, null=True)), ('last_login', models.DateTimeField(verbose_name='last login', null=True, blank=True)),
('username', models.CharField(validators=[django.core.validators.RegexValidator('^[\\w.-]+$', 'Enter a valid username.', 'invalid')], help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', unique=True, max_length=32, verbose_name='username')), ('username', models.CharField(max_length=32, verbose_name='username', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', unique=True, validators=[django.core.validators.RegexValidator('^[\\w.-]+$', 'Enter a valid username.', 'invalid')])),
('short_name', models.CharField(blank=True, max_length=64, verbose_name='short name')), ('short_name', models.CharField(max_length=64, verbose_name='short name', blank=True)),
('full_name', models.CharField(max_length=256, verbose_name='full name')), ('full_name', models.CharField(max_length=256, verbose_name='full name')),
('email', models.EmailField(help_text='Used for password recovery', verbose_name='email address', max_length=254)), ('email', models.EmailField(max_length=254, verbose_name='email address', help_text='Used for password recovery')),
('type', models.CharField(choices=[('INDIVIDUAL', 'Individual'), ('ASSOCIATION', 'Association'), ('CUSTOMER', 'Customer'), ('STAFF', 'Staff'), ('FRIEND', 'Friend')], default='INDIVIDUAL', max_length=32, verbose_name='type')), ('type', models.CharField(max_length=32, verbose_name='type', choices=[('INDIVIDUAL', 'Individual'), ('ASSOCIATION', 'Association'), ('CUSTOMER', 'Customer'), ('STAFF', 'Staff'), ('FRIEND', 'Friend')], default='INDIVIDUAL')),
('language', models.CharField(choices=[('CA', 'Catalan'), ('ES', 'Spanish'), ('EN', 'English')], default='CA', max_length=2, verbose_name='language')), ('language', models.CharField(max_length=2, verbose_name='language', choices=[('CA', 'Catalan'), ('ES', 'Spanish'), ('EN', 'English')], default='CA')),
('comments', models.TextField(blank=True, max_length=256, verbose_name='comments')), ('comments', models.TextField(max_length=256, verbose_name='comments', blank=True)),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), ('is_superuser', models.BooleanField(verbose_name='superuser status', help_text='Designates that this user has all permissions without explicitly assigning them.', default=False)),
('is_active', models.BooleanField(default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), ('date_joined', models.DateTimeField(verbose_name='date joined', default=django.utils.timezone.now)),
('main_systemuser', models.ForeignKey(related_name='accounts_main', null=True, editable=False, to='systemusers.SystemUser')), # ('main_systemuser', models.ForeignKey(null=True, editable=False, related_name='accounts_main', to='systemusers.SystemUser')),
], ],
options={ options={
'abstract': False, 'abstract': False,

View File

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
import django.core.validators
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Account',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(verbose_name='last login', null=True, blank=True)),
('username', models.CharField(max_length=32, verbose_name='username', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', unique=True, validators=[django.core.validators.RegexValidator('^[\\w.-]+$', 'Enter a valid username.', 'invalid')])),
('short_name', models.CharField(max_length=64, verbose_name='short name', blank=True)),
('full_name', models.CharField(max_length=256, verbose_name='full name')),
('email', models.EmailField(max_length=254, verbose_name='email address', help_text='Used for password recovery')),
('type', models.CharField(max_length=32, verbose_name='type', choices=[('INDIVIDUAL', 'Individual'), ('ASSOCIATION', 'Association'), ('CUSTOMER', 'Customer'), ('STAFF', 'Staff'), ('FRIEND', 'Friend')], default='INDIVIDUAL')),
('language', models.CharField(max_length=2, verbose_name='language', choices=[('CA', 'Catalan'), ('ES', 'Spanish'), ('EN', 'English')], default='CA')),
('comments', models.TextField(max_length=256, verbose_name='comments', blank=True)),
('is_superuser', models.BooleanField(verbose_name='superuser status', help_text='Designates that this user has all permissions without explicitly assigning them.', default=False)),
('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)),
('date_joined', models.DateTimeField(verbose_name='date joined', default=django.utils.timezone.now)),
('main_systemuser', models.ForeignKey(null=True, editable=False, related_name='accounts_main', to='systemusers.SystemUser')),
],
options={
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,8 +2,8 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.core.validators
from django.conf import settings from django.conf import settings
import orchestra.core.validators
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -16,20 +16,20 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Database', name='Database',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
('name', models.CharField(max_length=64, validators=[orchestra.core.validators.validate_name], verbose_name='name')), ('name', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='name', max_length=64)),
('type', models.CharField(max_length=32, default='mysql', choices=[('mysql', 'MySQL')], verbose_name='type')), ('type', models.CharField(max_length=32, verbose_name='type', choices=[('mysql', 'MySQL')], default='mysql')),
('account', models.ForeignKey(verbose_name='Account', to=settings.AUTH_USER_MODEL, related_name='databases')), ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', related_name='databases')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='DatabaseUser', name='DatabaseUser',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
('username', models.CharField(max_length=16, validators=[orchestra.core.validators.validate_name], verbose_name='username')), ('username', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='username', max_length=16)),
('password', models.CharField(max_length=256, verbose_name='password')), ('password', models.CharField(verbose_name='password', max_length=256)),
('type', models.CharField(max_length=32, default='mysql', choices=[('mysql', 'MySQL')], verbose_name='type')), ('type', models.CharField(max_length=32, verbose_name='type', choices=[('mysql', 'MySQL')], default='mysql')),
('account', models.ForeignKey(verbose_name='Account', to=settings.AUTH_USER_MODEL, related_name='databaseusers')), ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', related_name='databaseusers')),
], ],
options={ options={
'verbose_name_plural': 'DB users', 'verbose_name_plural': 'DB users',
@ -38,7 +38,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='database', model_name='database',
name='users', name='users',
field=models.ManyToManyField(verbose_name='users', related_name='databases', to='databases.DatabaseUser'), field=models.ManyToManyField(to='databases.DatabaseUser', verbose_name='users', blank=True, related_name='databases'),
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='databaseuser', name='databaseuser',

View File

@ -2,9 +2,9 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.contrib.domains.utils
import orchestra.contrib.domains.validators import orchestra.contrib.domains.validators
from django.conf import settings from django.conf import settings
import orchestra.contrib.domains.utils
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -17,21 +17,21 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Domain', name='Domain',
fields=[ fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(validators=[orchestra.contrib.domains.validators.validate_domain_name, orchestra.contrib.domains.validators.validate_allowed_domain], help_text='Domain or subdomain name.', unique=True, max_length=256, verbose_name='name')), ('name', models.CharField(validators=[orchestra.contrib.domains.validators.validate_domain_name, orchestra.contrib.domains.validators.validate_allowed_domain], max_length=256, help_text='Domain or subdomain name.', unique=True, verbose_name='name')),
('serial', models.IntegerField(help_text='Serial number', default=orchestra.contrib.domains.utils.generate_zone_serial, verbose_name='serial')), ('serial', models.IntegerField(default=orchestra.contrib.domains.utils.generate_zone_serial, help_text='Serial number', verbose_name='serial')),
('account', models.ForeignKey(help_text='Automatically selected for subdomains.', blank=True, verbose_name='Account', to=settings.AUTH_USER_MODEL, related_name='domains')), ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', blank=True, help_text='Automatically selected for subdomains.', related_name='domains')),
('top', models.ForeignKey(related_name='subdomain_set', null=True, to='domains.Domain', editable=False)), ('top', models.ForeignKey(to='domains.Domain', null=True, editable=False, related_name='subdomain_set')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Record', name='Record',
fields=[ fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ttl', models.CharField(validators=[orchestra.contrib.domains.validators.validate_zone_interval], help_text='Record TTL, defaults to 1h', blank=True, max_length=8, verbose_name='TTL')), ('ttl', models.CharField(validators=[orchestra.contrib.domains.validators.validate_zone_interval], max_length=8, help_text='Record TTL, defaults to 1h', blank=True, verbose_name='TTL')),
('type', models.CharField(choices=[('MX', 'MX'), ('NS', 'NS'), ('CNAME', 'CNAME'), ('A', 'A (IPv4 address)'), ('AAAA', 'AAAA (IPv6 address)'), ('SRV', 'SRV'), ('TXT', 'TXT'), ('SOA', 'SOA')], max_length=32, verbose_name='type')), ('type', models.CharField(max_length=32, choices=[('MX', 'MX'), ('NS', 'NS'), ('CNAME', 'CNAME'), ('A', 'A (IPv4 address)'), ('AAAA', 'AAAA (IPv6 address)'), ('SRV', 'SRV'), ('TXT', 'TXT'), ('SOA', 'SOA')], verbose_name='type')),
('value', models.CharField(max_length=256, verbose_name='value')), ('value', models.CharField(max_length=256, verbose_name='value')),
('domain', models.ForeignKey(verbose_name='domain', to='domains.Domain', related_name='records')), ('domain', models.ForeignKey(to='domains.Domain', verbose_name='domain', related_name='records')),
], ],
), ),
] ]

View File

@ -2,8 +2,8 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
from django.conf import settings
import orchestra.models.fields import orchestra.models.fields
from django.conf import settings
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -16,11 +16,11 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Message', name='Message',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('author_name', models.CharField(verbose_name='author name', blank=True, max_length=256)), ('author_name', models.CharField(verbose_name='author name', max_length=256, blank=True)),
('content', models.TextField(verbose_name='content')), ('content', models.TextField(verbose_name='content')),
('created_on', models.DateTimeField(verbose_name='created on', auto_now_add=True)), ('created_on', models.DateTimeField(verbose_name='created on', auto_now_add=True)),
('author', models.ForeignKey(verbose_name='author', related_name='ticket_messages', to=settings.AUTH_USER_MODEL)), ('author', models.ForeignKey(related_name='ticket_messages', to=settings.AUTH_USER_MODEL, verbose_name='author')),
], ],
options={ options={
'get_latest_by': 'id', 'get_latest_by': 'id',
@ -29,28 +29,28 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Queue', name='Queue',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('name', models.CharField(verbose_name='name', unique=True, max_length=128)), ('name', models.CharField(unique=True, verbose_name='name', max_length=128)),
('verbose_name', models.CharField(verbose_name='verbose_name', blank=True, max_length=128)), ('verbose_name', models.CharField(verbose_name='verbose_name', max_length=128, blank=True)),
('default', models.BooleanField(verbose_name='default', default=False)), ('default', models.BooleanField(default=False, verbose_name='default')),
('notify', orchestra.models.fields.MultiSelectField(blank=True, default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')], help_text='Contacts to notify by email', verbose_name='notify', max_length=256)), ('notify', orchestra.models.fields.MultiSelectField(choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')], help_text='Contacts to notify by email', verbose_name='notify', blank=True, default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), max_length=256)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Ticket', name='Ticket',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('creator_name', models.CharField(verbose_name='creator name', blank=True, max_length=256)), ('creator_name', models.CharField(verbose_name='creator name', max_length=256, blank=True)),
('subject', models.CharField(verbose_name='subject', max_length=256)), ('subject', models.CharField(verbose_name='subject', max_length=256)),
('description', models.TextField(verbose_name='description')), ('description', models.TextField(verbose_name='description')),
('priority', models.CharField(choices=[('HIGH', 'High'), ('MEDIUM', 'Medium'), ('LOW', 'Low')], verbose_name='priority', default='MEDIUM', max_length=32)), ('priority', models.CharField(choices=[('HIGH', 'High'), ('MEDIUM', 'Medium'), ('LOW', 'Low')], default='MEDIUM', max_length=32, verbose_name='priority')),
('state', models.CharField(choices=[('NEW', 'New'), ('IN_PROGRESS', 'In Progress'), ('RESOLVED', 'Resolved'), ('FEEDBACK', 'Feedback'), ('REJECTED', 'Rejected'), ('CLOSED', 'Closed')], verbose_name='state', default='NEW', max_length=32)), ('state', models.CharField(choices=[('NEW', 'New'), ('IN_PROGRESS', 'In Progress'), ('RESOLVED', 'Resolved'), ('FEEDBACK', 'Feedback'), ('REJECTED', 'Rejected'), ('CLOSED', 'Closed')], default='NEW', max_length=32, verbose_name='state')),
('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)), ('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)),
('updated_at', models.DateTimeField(verbose_name='modified', auto_now=True)), ('updated_at', models.DateTimeField(verbose_name='modified', auto_now=True)),
('cc', models.TextField(verbose_name='CC', blank=True, help_text='emails to send a carbon copy to')), ('cc', models.TextField(help_text='emails to send a carbon copy to', verbose_name='CC', blank=True)),
('creator', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='created by', related_name='tickets_created', null=True)), ('creator', models.ForeignKey(null=True, related_name='tickets_created', to=settings.AUTH_USER_MODEL, verbose_name='created by')),
('owner', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='assigned to', related_name='tickets_owned', null=True)), ('owner', models.ForeignKey(null=True, related_name='tickets_owned', blank=True, to=settings.AUTH_USER_MODEL, verbose_name='assigned to')),
('queue', models.ForeignKey(blank=True, to='issues.Queue', related_name='tickets', null=True)), ('queue', models.ForeignKey(null=True, related_name='tickets', blank=True, to='issues.Queue')),
], ],
options={ options={
'ordering': ['-updated_at'], 'ordering': ['-updated_at'],
@ -59,15 +59,15 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='TicketTracker', name='TicketTracker',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('ticket', models.ForeignKey(verbose_name='ticket', related_name='trackers', to='issues.Ticket')), ('ticket', models.ForeignKey(related_name='trackers', to='issues.Ticket', verbose_name='ticket')),
('user', models.ForeignKey(verbose_name='user', related_name='ticket_trackers', to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(related_name='ticket_trackers', to=settings.AUTH_USER_MODEL, verbose_name='user')),
], ],
), ),
migrations.AddField( migrations.AddField(
model_name='message', model_name='message',
name='ticket', name='ticket',
field=models.ForeignKey(verbose_name='ticket', related_name='messages', to='issues.Ticket'), field=models.ForeignKey(related_name='messages', to='issues.Ticket', verbose_name='ticket'),
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='tickettracker', name='tickettracker',

View File

@ -2,28 +2,28 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
from django.conf import settings
import orchestra.core.validators import orchestra.core.validators
from django.conf import settings
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('domains', '0001_initial'), ('domains', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='List', name='List',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, primary_key=True, auto_created=True)), ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
('name', models.CharField(max_length=128, unique=True, verbose_name='name', validators=[orchestra.core.validators.validate_name], help_text='Default list address <name>@lists.pangea.org')), ('name', models.CharField(verbose_name='name', help_text='Default list address <name>@lists.pangea.org', validators=[orchestra.core.validators.validate_name], max_length=128, unique=True)),
('address_name', models.CharField(blank=True, verbose_name='address name', validators=[orchestra.core.validators.validate_name], max_length=128)), ('address_name', models.CharField(verbose_name='address name', blank=True, validators=[orchestra.core.validators.validate_name], max_length=128)),
('admin_email', models.EmailField(max_length=254, verbose_name='admin email', help_text='Administration email address')), ('admin_email', models.EmailField(verbose_name='admin email', help_text='Administration email address', max_length=254)),
('is_active', models.BooleanField(verbose_name='active', default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.')), ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)),
('account', models.ForeignKey(related_name='lists', verbose_name='Account', to=settings.AUTH_USER_MODEL)), ('account', models.ForeignKey(verbose_name='Account', related_name='lists', to=settings.AUTH_USER_MODEL)),
('address_domain', models.ForeignKey(blank=True, null=True, verbose_name='address domain', to='domains.Domain')), ('address_domain', models.ForeignKey(verbose_name='address domain', null=True, blank=True, to='domains.Domain')),
], ],
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(

View File

@ -2,27 +2,27 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.contrib.mailboxes.validators
from django.conf import settings from django.conf import settings
import orchestra.contrib.mailboxes.validators
import django.core.validators import django.core.validators
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('domains', '0001_initial'), ('domains', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='Address', name='Address',
fields=[ fields=[
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64, validators=[orchestra.contrib.mailboxes.validators.validate_emailname], help_text='Address name, left blank for a <i>catch-all</i> address', verbose_name='name', blank=True)), ('name', models.CharField(help_text='Address name, left blank for a <i>catch-all</i> address', validators=[orchestra.contrib.mailboxes.validators.validate_emailname], verbose_name='name', blank=True, max_length=64)),
('forward', models.CharField(max_length=256, validators=[orchestra.contrib.mailboxes.validators.validate_forward], help_text='Space separated email addresses or mailboxes', verbose_name='forward', blank=True)), ('forward', models.CharField(help_text='Space separated email addresses or mailboxes', validators=[orchestra.contrib.mailboxes.validators.validate_forward], verbose_name='forward', blank=True, max_length=256)),
('account', models.ForeignKey(related_name='addresses', verbose_name='Account', to=settings.AUTH_USER_MODEL)), ('account', models.ForeignKey(related_name='addresses', to=settings.AUTH_USER_MODEL, verbose_name='Account')),
('domain', models.ForeignKey(related_name='addresses', verbose_name='domain', to='domains.Domain')), ('domain', models.ForeignKey(related_name='addresses', to='domains.Domain', verbose_name='domain')),
], ],
options={ options={
'verbose_name_plural': 'addresses', 'verbose_name_plural': 'addresses',
@ -31,23 +31,23 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Autoresponse', name='Autoresponse',
fields=[ fields=[
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('subject', models.CharField(max_length=256, verbose_name='subject')), ('subject', models.CharField(verbose_name='subject', max_length=256)),
('message', models.TextField(verbose_name='message')), ('message', models.TextField(verbose_name='message')),
('enabled', models.BooleanField(default=False, verbose_name='enabled')), ('enabled', models.BooleanField(default=False, verbose_name='enabled')),
('address', models.OneToOneField(related_name='autoresponse', verbose_name='address', to='mailboxes.Address')), ('address', models.OneToOneField(related_name='autoresponse', to='mailboxes.Address', verbose_name='address')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Mailbox', name='Mailbox',
fields=[ fields=[
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid mailbox name.')], max_length=64, unique=True, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', verbose_name='name')), ('name', models.CharField(unique=True, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid mailbox name.')], verbose_name='name', max_length=64)),
('password', models.CharField(max_length=128, verbose_name='password')), ('password', models.CharField(verbose_name='password', max_length=128)),
('filtering', models.CharField(default='REDIRECT', max_length=16, choices=[('DISABLE', 'Disable'), ('CUSTOM', 'Custom filtering'), ('REDIRECT', 'Archive spam'), ('REJECT', 'Reject spam')])), ('filtering', models.CharField(choices=[('REJECT', 'Reject spam (X-Spam-Score&ge;9)'), ('REDIRECT', 'Archive spam (X-Spam-Score&ge;9)'), ('DISABLE', 'Disable'), ('CUSTOM', 'Custom filtering')], default='REDIRECT', max_length=16)),
('custom_filtering', models.TextField(validators=[orchestra.contrib.mailboxes.validators.validate_sieve], help_text='Arbitrary email filtering in sieve language. This overrides any automatic junk email filtering', verbose_name='filtering', blank=True)), ('custom_filtering', models.TextField(help_text='Arbitrary email filtering in sieve language. This overrides any automatic junk email filtering', validators=[orchestra.contrib.mailboxes.validators.validate_sieve], verbose_name='filtering', blank=True)),
('is_active', models.BooleanField(default=True, verbose_name='active')), ('is_active', models.BooleanField(default=True, verbose_name='active')),
('account', models.ForeignKey(related_name='mailboxes', verbose_name='account', to=settings.AUTH_USER_MODEL)), ('account', models.ForeignKey(related_name='mailboxes', to=settings.AUTH_USER_MODEL, verbose_name='account')),
], ],
options={ options={
'verbose_name_plural': 'mailboxes', 'verbose_name_plural': 'mailboxes',
@ -56,7 +56,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='address', model_name='address',
name='mailboxes', name='mailboxes',
field=models.ManyToManyField(related_name='addresses', verbose_name='mailboxes', blank=True, to='mailboxes.Mailbox'), field=models.ManyToManyField(related_name='addresses', to='mailboxes.Mailbox', verbose_name='mailboxes', blank=True),
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='address', name='address',

View File

@ -2,9 +2,9 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.models.fields
import orchestra.core.validators import orchestra.core.validators
from django.conf import settings from django.conf import settings
import orchestra.models.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -17,11 +17,11 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Miscellaneous', name='Miscellaneous',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('identifier', orchestra.models.fields.NullableCharField(max_length=256, unique=True, verbose_name='identifier', null=True, help_text='A unique identifier for this service.')), ('identifier', orchestra.models.fields.NullableCharField(null=True, verbose_name='identifier', unique=True, help_text='A unique identifier for this service.', max_length=256)),
('description', models.TextField(blank=True, verbose_name='description')), ('description', models.TextField(verbose_name='description', blank=True)),
('amount', models.PositiveIntegerField(default=1, verbose_name='amount')), ('amount', models.PositiveIntegerField(verbose_name='amount', default=1)),
('is_active', models.BooleanField(default=True, help_text='Designates whether this service should be treated as active. Unselect this instead of deleting services.', verbose_name='active')), ('is_active', models.BooleanField(help_text='Designates whether this service should be treated as active. Unselect this instead of deleting services.', verbose_name='active', default=True)),
('account', models.ForeignKey(verbose_name='account', to=settings.AUTH_USER_MODEL, related_name='miscellaneous')), ('account', models.ForeignKey(verbose_name='account', to=settings.AUTH_USER_MODEL, related_name='miscellaneous')),
], ],
options={ options={
@ -31,13 +31,13 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='MiscService', name='MiscService',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=32, validators=[orchestra.core.validators.validate_name], unique=True, verbose_name='name', help_text='Raw name used for internal referenciation, i.e. service match definition')), ('name', models.CharField(verbose_name='name', unique=True, validators=[orchestra.core.validators.validate_name], max_length=32, help_text='Raw name used for internal referenciation, i.e. service match definition')),
('verbose_name', models.CharField(blank=True, max_length=256, verbose_name='verbose name', help_text='Human readable name')), ('verbose_name', models.CharField(verbose_name='verbose name', max_length=256, blank=True, help_text='Human readable name')),
('description', models.TextField(blank=True, help_text='Optional description', verbose_name='description')), ('description', models.TextField(verbose_name='description', blank=True, help_text='Optional description')),
('has_identifier', models.BooleanField(default=True, help_text='Designates if this service has a <b>unique text</b> field that identifies it or not.', verbose_name='has identifier')), ('has_identifier', models.BooleanField(help_text='Designates if this service has a <b>unique text</b> field that identifies it or not.', verbose_name='has identifier', default=True)),
('has_amount', models.BooleanField(default=False, help_text='Designates whether this service has <tt>amount</tt> property or not.', verbose_name='has amount')), ('has_amount', models.BooleanField(help_text='Designates whether this service has <tt>amount</tt> property or not.', verbose_name='has amount', default=False)),
('is_active', models.BooleanField(default=True, help_text='Whether new instances of this service can be created or not. Unselect this instead of deleting services.', verbose_name='active')), ('is_active', models.BooleanField(help_text='Whether new instances of this service can be created or not. Unselect this instead of deleting services.', verbose_name='active', default=True)),
], ],
), ),
migrations.AddField( migrations.AddField(

View File

@ -15,17 +15,17 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='BackendLog', name='BackendLog',
fields=[ fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('backend', models.CharField(verbose_name='backend', max_length=256)), ('backend', models.CharField(max_length=256, verbose_name='backend')),
('state', models.CharField(choices=[('RECEIVED', 'RECEIVED'), ('TIMEOUT', 'TIMEOUT'), ('STARTED', 'STARTED'), ('SUCCESS', 'SUCCESS'), ('FAILURE', 'FAILURE'), ('ERROR', 'ERROR'), ('REVOKED', 'REVOKED')], verbose_name='state', max_length=16, default='RECEIVED')), ('state', models.CharField(choices=[('RECEIVED', 'RECEIVED'), ('TIMEOUT', 'TIMEOUT'), ('STARTED', 'STARTED'), ('SUCCESS', 'SUCCESS'), ('FAILURE', 'FAILURE'), ('ERROR', 'ERROR'), ('ABORTED', 'ABORTED'), ('REVOKED', 'REVOKED')], max_length=16, default='RECEIVED', verbose_name='state')),
('script', models.TextField(verbose_name='script')), ('script', models.TextField(verbose_name='script')),
('stdout', models.TextField(verbose_name='stdout')), ('stdout', models.TextField(verbose_name='stdout')),
('stderr', models.TextField(verbose_name='stdin')), ('stderr', models.TextField(verbose_name='stdin')),
('traceback', models.TextField(verbose_name='traceback')), ('traceback', models.TextField(verbose_name='traceback')),
('exit_code', models.IntegerField(null=True, verbose_name='exit code')), ('exit_code', models.IntegerField(null=True, verbose_name='exit code')),
('task_id', models.CharField(null=True, verbose_name='task ID', unique=True, max_length=36, help_text='Celery task ID when used as execution backend')), ('task_id', models.CharField(null=True, max_length=36, help_text='Celery task ID when used as execution backend', unique=True, verbose_name='task ID')),
('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created')),
('updated_at', models.DateTimeField(verbose_name='updated', auto_now=True)), ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated')),
], ],
options={ options={
'get_latest_by': 'id', 'get_latest_by': 'id',
@ -34,35 +34,35 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='BackendOperation', name='BackendOperation',
fields=[ fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('backend', models.CharField(verbose_name='backend', max_length=256)), ('backend', models.CharField(max_length=256, verbose_name='backend')),
('action', models.CharField(verbose_name='action', max_length=64)), ('action', models.CharField(max_length=64, verbose_name='action')),
('object_id', models.PositiveIntegerField()), ('object_id', models.PositiveIntegerField()),
('content_type', models.ForeignKey(to='contenttypes.ContentType')), ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('log', models.ForeignKey(related_name='operations', to='orchestration.BackendLog')), ('log', models.ForeignKey(to='orchestration.BackendLog', related_name='operations')),
], ],
options={ options={
'verbose_name': 'Operation',
'verbose_name_plural': 'Operations', 'verbose_name_plural': 'Operations',
'verbose_name': 'Operation',
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='Route', name='Route',
fields=[ fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('backend', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MailmanTrafficBash', '[M] Mailman traffic (Bash)'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserBackend', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailmanBackend', '[S] Mailman'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PostfixAddressBackend', '[S] Postfix address'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('PhpListSaaSBackend', '[S] phpList SaaS')], verbose_name='backend', max_length=256)), ('backend', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserBackend', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailmanBackend', '[S] Mailman'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PostfixAddressBackend', '[S] Postfix address'), ('uWSGIPythonBackend', '[S] Python uWSGI'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('SyncBind9MasterDomainBackend', '[S] Sync Bind9 master domain'), ('SyncBind9SlaveDomainBackend', '[S] Sync Bind9 slave domain'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('PhpListSaaSBackend', '[S] phpList SaaS')], max_length=256, verbose_name='backend')),
('match', models.CharField(blank=True, default='True', verbose_name='match', max_length=256, help_text='Python expression used for selecting the targe host, <em>instance</em> referes to the current object.')), ('match', models.CharField(max_length=256, default='True', blank=True, help_text='Python expression used for selecting the targe host, <em>instance</em> referes to the current object.', verbose_name='match')),
('is_active', models.BooleanField(verbose_name='active', default=True)), ('is_active', models.BooleanField(default=True, verbose_name='active')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Server', name='Server',
fields=[ fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('name', models.CharField(verbose_name='name', unique=True, max_length=256)), ('name', models.CharField(max_length=256, unique=True, verbose_name='name')),
('address', orchestra.models.fields.NullableCharField(blank=True, unique=True, help_text='IP address or domain name', null=True, verbose_name='address', max_length=256)), ('address', orchestra.models.fields.NullableCharField(null=True, help_text='IP address or domain name', verbose_name='address', max_length=256, unique=True, blank=True)),
('description', models.TextField(blank=True, verbose_name='description')), ('description', models.TextField(blank=True, verbose_name='description')),
('os', models.CharField(choices=[('LINUX', 'Linux')], verbose_name='operative system', max_length=32, default='LINUX')), ('os', models.CharField(choices=[('LINUX', 'Linux')], max_length=32, default='LINUX', verbose_name='operative system')),
], ],
), ),
migrations.AddField( migrations.AddField(
@ -73,7 +73,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='backendlog', model_name='backendlog',
name='server', name='server',
field=models.ForeignKey(to='orchestration.Server', related_name='execution_logs', verbose_name='server'), field=models.ForeignKey(verbose_name='server', related_name='execution_logs', to='orchestration.Server'),
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='route', name='route',

View File

@ -2,25 +2,25 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import django.utils.timezone
from django.conf import settings from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL), migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('services', '0001_initial'), ('contenttypes', '0002_remove_content_type_name'),
('services', '__first__'),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='MetricStorage', name='MetricStorage',
fields=[ fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
('value', models.DecimalField(verbose_name='value', decimal_places=2, max_digits=16)), ('value', models.DecimalField(max_digits=16, decimal_places=2, verbose_name='value')),
('created_on', models.DateField(verbose_name='created', auto_now_add=True)), ('created_on', models.DateField(auto_now_add=True, verbose_name='created')),
('updated_on', models.DateTimeField(verbose_name='updated')), ('updated_on', models.DateTimeField(verbose_name='updated')),
], ],
options={ options={
@ -30,17 +30,17 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Order', name='Order',
fields=[ fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
('object_id', models.PositiveIntegerField(null=True)), ('object_id', models.PositiveIntegerField(null=True)),
('registered_on', models.DateField(verbose_name='registered', default=django.utils.timezone.now)), ('registered_on', models.DateField(default=django.utils.timezone.now, verbose_name='registered')),
('cancelled_on', models.DateField(blank=True, verbose_name='cancelled', null=True)), ('cancelled_on', models.DateField(blank=True, null=True, verbose_name='cancelled')),
('billed_on', models.DateField(blank=True, verbose_name='billed', null=True)), ('billed_on', models.DateField(blank=True, null=True, verbose_name='billed')),
('billed_until', models.DateField(blank=True, verbose_name='billed until', null=True)), ('billed_until', models.DateField(blank=True, null=True, verbose_name='billed until')),
('ignore', models.BooleanField(verbose_name='ignore', default=False)), ('ignore', models.BooleanField(default=False, verbose_name='ignore')),
('description', models.TextField(blank=True, verbose_name='description')), ('description', models.TextField(blank=True, verbose_name='description')),
('account', models.ForeignKey(related_name='orders', verbose_name='account', to=settings.AUTH_USER_MODEL)), ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='orders', verbose_name='account')),
('content_type', models.ForeignKey(to='contenttypes.ContentType')), ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('service', models.ForeignKey(related_name='orders', verbose_name='service', to='services.Service')), ('service', models.ForeignKey(to='services.Service', related_name='orders', verbose_name='service')),
], ],
options={ options={
'get_latest_by': 'id', 'get_latest_by': 'id',
@ -49,6 +49,6 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='metricstorage', model_name='metricstorage',
name='order', name='order',
field=models.ForeignKey(related_name='metrics', verbose_name='order', to='orders.Order'), field=models.ForeignKey(to='orders.Order', related_name='metrics', verbose_name='order'),
), ),
] ]

View File

@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('bills', '0002_auto_20150429_1343'),
]
operations = [
migrations.CreateModel(
name='PaymentSource',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('method', models.CharField(verbose_name='method', choices=[('SEPADirectDebit', 'SEPA Direct Debit')], max_length=32)),
('data', jsonfield.fields.JSONField(verbose_name='data', default={})),
('is_active', models.BooleanField(verbose_name='active', default=True)),
('account', models.ForeignKey(related_name='paymentsources', verbose_name='account', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Transaction',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('state', models.CharField(verbose_name='state', choices=[('WAITTING_PROCESSING', 'Waitting processing'), ('WAITTING_EXECUTION', 'Waitting execution'), ('EXECUTED', 'Executed'), ('SECURED', 'Secured'), ('REJECTED', 'Rejected')], max_length=32, default='WAITTING_PROCESSING')),
('amount', models.DecimalField(verbose_name='amount', max_digits=12, decimal_places=2)),
('currency', models.CharField(max_length=10, default='Eur')),
('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)),
('modified_at', models.DateTimeField(verbose_name='modified', auto_now=True)),
('bill', models.ForeignKey(related_name='transactions', verbose_name='bill', to='bills.Bill')),
],
),
migrations.CreateModel(
name='TransactionProcess',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('data', jsonfield.fields.JSONField(verbose_name='data', blank=True)),
('file', models.FileField(verbose_name='file', blank=True, upload_to='')),
('state', models.CharField(verbose_name='state', choices=[('CREATED', 'Created'), ('EXECUTED', 'Executed'), ('ABORTED', 'Aborted'), ('COMMITED', 'Commited')], max_length=16, default='CREATED')),
('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)),
('updated_at', models.DateTimeField(verbose_name='updated', auto_now=True)),
],
options={
'verbose_name_plural': 'Transaction processes',
},
),
migrations.AddField(
model_name='transaction',
name='process',
field=models.ForeignKey(related_name='transactions', blank=True, null=True, verbose_name='process', to='payments.TransactionProcess'),
),
migrations.AddField(
model_name='transaction',
name='source',
field=models.ForeignKey(related_name='transactions', blank=True, null=True, verbose_name='source', to='payments.PaymentSource'),
),
]

View File

@ -2,23 +2,23 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.core.validators
from django.conf import settings from django.conf import settings
import orchestra.core.validators
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('services', '__first__'), ('services', '__first__'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='ContractedPlan', name='ContractedPlan',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('account', models.ForeignKey(related_name='plans', verbose_name='account', to=settings.AUTH_USER_MODEL)), ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='account', related_name='plans')),
], ],
options={ options={
'verbose_name_plural': 'plans', 'verbose_name_plural': 'plans',
@ -27,29 +27,29 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Plan', name='Plan',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(verbose_name='name', unique=True, validators=[orchestra.core.validators.validate_name], max_length=32)), ('name', models.CharField(validators=[orchestra.core.validators.validate_name], unique=True, max_length=32, verbose_name='name')),
('verbose_name', models.CharField(verbose_name='verbose_name', max_length=128, blank=True)), ('verbose_name', models.CharField(max_length=128, verbose_name='verbose_name', blank=True)),
('is_active', models.BooleanField(verbose_name='active', default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.')), ('is_active', models.BooleanField(default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('is_default', models.BooleanField(verbose_name='default', default=False, help_text='Designates whether this plan is used by default or not.')), ('is_default', models.BooleanField(default=False, help_text='Designates whether this plan is used by default or not.', verbose_name='default')),
('is_combinable', models.BooleanField(verbose_name='combinable', default=True, help_text='Designates whether this plan can be combined with other plans or not.')), ('is_combinable', models.BooleanField(default=True, help_text='Designates whether this plan can be combined with other plans or not.', verbose_name='combinable')),
('allow_multiple', models.BooleanField(verbose_name='allow multiple', default=False, help_text='Designates whether this plan allow for multiple contractions.')), ('allow_multiple', models.BooleanField(default=False, help_text='Designates whether this plan allow for multiple contractions.', verbose_name='allow multiple')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Rate', name='Rate',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('quantity', models.PositiveIntegerField(verbose_name='quantity', null=True, blank=True)), ('quantity', models.PositiveIntegerField(null=True, help_text='See rate algorihm help text.', verbose_name='quantity', blank=True)),
('price', models.DecimalField(verbose_name='price', decimal_places=2, max_digits=12)), ('price', models.DecimalField(max_digits=12, verbose_name='price', decimal_places=2)),
('plan', models.ForeignKey(related_name='rates', verbose_name='plan', to='plans.Plan')), ('plan', models.ForeignKey(to='plans.Plan', verbose_name='plan', related_name='rates')),
('service', models.ForeignKey(related_name='rates', verbose_name='service', to='services.Service')), ('service', models.ForeignKey(to='services.Service', verbose_name='service', related_name='rates')),
], ],
), ),
migrations.AddField( migrations.AddField(
model_name='contractedplan', model_name='contractedplan',
name='plan', name='plan',
field=models.ForeignKey(related_name='contracts', verbose_name='plan', to='plans.Plan'), field=models.ForeignKey(to='plans.Plan', verbose_name='plan', related_name='contracts'),
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='rate', name='rate',

View File

@ -2,10 +2,10 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.core.validators import django.utils.timezone
import orchestra.contrib.resources.validators import orchestra.contrib.resources.validators
import orchestra.models.fields import orchestra.models.fields
import django.utils.timezone import orchestra.core.validators
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -19,46 +19,46 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='MonitorData', name='MonitorData',
fields=[ fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('monitor', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MailmanTrafficBash', '[M] Mailman traffic (Bash)'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], verbose_name='monitor', max_length=256)), ('monitor', models.CharField(max_length=256, choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], verbose_name='monitor')),
('object_id', models.PositiveIntegerField(verbose_name='object id')), ('object_id', models.PositiveIntegerField(verbose_name='object id')),
('created_at', models.DateTimeField(verbose_name='created', default=django.utils.timezone.now)), ('created_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='created')),
('value', models.DecimalField(verbose_name='value', max_digits=16, decimal_places=2)), ('value', models.DecimalField(max_digits=16, decimal_places=2, verbose_name='value')),
('content_type', models.ForeignKey(verbose_name='content type', to='contenttypes.ContentType')), ('content_type', models.ForeignKey(to='contenttypes.ContentType', verbose_name='content type')),
], ],
options={ options={
'get_latest_by': 'id',
'verbose_name_plural': 'monitor data', 'verbose_name_plural': 'monitor data',
'get_latest_by': 'id',
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='Resource', name='Resource',
fields=[ fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='name', max_length=32, help_text='Required. 32 characters or fewer. Lowercase letters, digits and hyphen only.')), ('name', models.CharField(validators=[orchestra.core.validators.validate_name], max_length=32, help_text='Required. 32 characters or fewer. Lowercase letters, digits and hyphen only.', verbose_name='name')),
('verbose_name', models.CharField(verbose_name='verbose name', max_length=256)), ('verbose_name', models.CharField(max_length=256, verbose_name='verbose name')),
('aggregation', models.CharField(choices=[('last-10-days-avg', 'Last 10 days AVG'), ('last', 'Last value'), ('monthly-avg', 'Monthly AVG'), ('monthly-sum', 'Monthly Sum')], verbose_name='aggregation', max_length=16, help_text='Method used for aggregating this resource monitored data.', default='last-10-days-avg')), ('aggregation', models.CharField(max_length=16, help_text='Method used for aggregating this resource monitored data.', choices=[('last-10-days-avg', 'Last 10 days AVG'), ('last', 'Last value'), ('monthly-avg', 'Monthly AVG'), ('monthly-sum', 'Monthly Sum')], default='last-10-days-avg', verbose_name='aggregation')),
('on_demand', models.BooleanField(verbose_name='on demand', default=False, help_text='If enabled the resource will not be pre-allocated, but allocated under the application demand')), ('on_demand', models.BooleanField(help_text='If enabled the resource will not be pre-allocated, but allocated under the application demand', default=False, verbose_name='on demand')),
('default_allocation', models.PositiveIntegerField(verbose_name='default allocation', help_text='Default allocation value used when this is not an on demand resource', null=True, blank=True)), ('default_allocation', models.PositiveIntegerField(help_text='Default allocation value used when this is not an on demand resource', blank=True, null=True, verbose_name='default allocation')),
('unit', models.CharField(verbose_name='unit', max_length=16, help_text='The unit in which this resource is represented. For example GB, KB or subscribers')), ('unit', models.CharField(max_length=16, help_text='The unit in which this resource is represented. For example GB, KB or subscribers', verbose_name='unit')),
('scale', models.CharField(validators=[orchestra.contrib.resources.validators.validate_scale], verbose_name='scale', max_length=32, help_text='Scale in which this resource monitoring resoults should be prorcessed to match with unit. e.g. <tt>10**9</tt>')), ('scale', models.CharField(validators=[orchestra.contrib.resources.validators.validate_scale], max_length=32, help_text='Scale in which this resource monitoring resoults should be prorcessed to match with unit. e.g. <tt>10**9</tt>', verbose_name='scale')),
('disable_trigger', models.BooleanField(verbose_name='disable trigger', default=False, help_text='Disables monitors exeeded and recovery triggers')), ('disable_trigger', models.BooleanField(help_text='Disables monitors exeeded and recovery triggers', default=False, verbose_name='disable trigger')),
('monitors', orchestra.models.fields.MultiSelectField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MailmanTrafficBash', '[M] Mailman traffic (Bash)'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], verbose_name='monitors', max_length=256, help_text='Monitor backends used for monitoring this resource.', blank=True)), ('monitors', orchestra.models.fields.MultiSelectField(max_length=256, help_text='Monitor backends used for monitoring this resource.', blank=True, choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], verbose_name='monitors')),
('is_active', models.BooleanField(verbose_name='active', default=True)), ('is_active', models.BooleanField(default=True, verbose_name='active')),
('content_type', models.ForeignKey(to='contenttypes.ContentType', help_text='Model where this resource will be hooked.')), ('content_type', models.ForeignKey(to='contenttypes.ContentType', help_text='Model where this resource will be hooked.')),
('crontab', models.ForeignKey(verbose_name='crontab', null=True, to='djcelery.CrontabSchedule', blank=True, help_text='Crontab for periodic execution. Leave it empty to disable periodic monitoring')), ('crontab', models.ForeignKey(null=True, verbose_name='crontab', to='djcelery.CrontabSchedule', help_text='Crontab for periodic execution. Leave it empty to disable periodic monitoring', blank=True)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='ResourceData', name='ResourceData',
fields=[ fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('object_id', models.PositiveIntegerField(verbose_name='object id')), ('object_id', models.PositiveIntegerField(verbose_name='object id')),
('used', models.DecimalField(editable=False, verbose_name='used', max_digits=16, null=True, decimal_places=3)), ('used', models.DecimalField(max_digits=16, editable=False, decimal_places=3, null=True, verbose_name='used')),
('updated_at', models.DateTimeField(editable=False, verbose_name='updated', null=True)), ('updated_at', models.DateTimeField(editable=False, null=True, verbose_name='updated')),
('allocated', models.DecimalField(decimal_places=2, verbose_name='allocated', max_digits=8, null=True, blank=True)), ('allocated', models.DecimalField(max_digits=8, blank=True, decimal_places=2, null=True, verbose_name='allocated')),
('content_type', models.ForeignKey(verbose_name='content type', to='contenttypes.ContentType')), ('content_type', models.ForeignKey(to='contenttypes.ContentType', verbose_name='content type')),
('resource', models.ForeignKey(verbose_name='resource', related_name='dataset', to='resources.Resource')), ('resource', models.ForeignKey(related_name='dataset', to='resources.Resource', verbose_name='resource')),
], ],
options={ options={
'verbose_name_plural': 'resource data', 'verbose_name_plural': 'resource data',
@ -70,6 +70,6 @@ class Migration(migrations.Migration):
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='resource', name='resource',
unique_together=set([('verbose_name', 'content_type'), ('name', 'content_type')]), unique_together=set([('name', 'content_type'), ('verbose_name', 'content_type')]),
), ),
] ]

View File

@ -2,29 +2,29 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.core.validators
import jsonfield.fields import jsonfield.fields
from django.conf import settings from django.conf import settings
import orchestra.core.validators
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('databases', '0001_initial'), ('databases', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='SaaS', name='SaaS',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)),
('service', models.CharField(verbose_name='service', max_length=32, choices=[('bscw', 'BSCW'), ('DokuWikiService', 'Dowkuwiki'), ('DrupalService', 'Drupal'), ('gitlab', 'GitLab'), ('MoodleService', 'Moodle'), ('seafile', 'SeaFile'), ('WordPressService', 'WordPress'), ('phplist', 'phpList')])), ('service', models.CharField(max_length=32, verbose_name='service', choices=[('bscw', 'BSCW'), ('DokuWikiService', 'Dowkuwiki'), ('DrupalService', 'Drupal'), ('gitlab', 'GitLab'), ('MoodleService', 'Moodle'), ('seafile', 'SeaFile'), ('WordPressService', 'WordPress'), ('phplist', 'phpList')])),
('name', models.CharField(help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', max_length=64, validators=[orchestra.core.validators.validate_username], verbose_name='Name')), ('name', models.CharField(help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', max_length=64, verbose_name='Name', validators=[orchestra.core.validators.validate_username])),
('is_active', models.BooleanField(help_text='Designates whether this service should be treated as active. ', verbose_name='active', default=True)), ('is_active', models.BooleanField(help_text='Designates whether this service should be treated as active. ', verbose_name='active', default=True)),
('data', jsonfield.fields.JSONField(help_text='Extra information dependent of each service.', verbose_name='data', default={})), ('data', jsonfield.fields.JSONField(help_text='Extra information dependent of each service.', verbose_name='data', default={})),
('account', models.ForeignKey(related_name='saas', to=settings.AUTH_USER_MODEL, verbose_name='account')), ('account', models.ForeignKey(verbose_name='account', to=settings.AUTH_USER_MODEL, related_name='saas')),
('database', models.ForeignKey(to='databases.Database', null=True, blank=True)), ('database', models.ForeignKey(null=True, blank=True, to='databases.Database')),
], ],
options={ options={
'verbose_name': 'SaaS', 'verbose_name': 'SaaS',

View File

@ -14,25 +14,25 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Service', name='Service',
fields=[ fields=[
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('description', models.CharField(verbose_name='description', max_length=256, unique=True)), ('description', models.CharField(unique=True, max_length=256, verbose_name='description')),
('match', models.CharField(verbose_name='match', help_text="Python <a href='https://docs.python.org/2/library/functions.html#eval'>expression</a> that designates wheter a <tt>content_type</tt> object is related to this service or not, always evaluates <tt>True</tt> when left blank. Related instance can be instantiated with <tt>instance</tt> keyword or <tt>content_type.model_name</tt>.</br><tt>&nbsp;databaseuser.type == 'MYSQL'</tt><br><tt>&nbsp;miscellaneous.active and str(miscellaneous.identifier).endswith(('.org', '.net', '.com'))</tt><br><tt>&nbsp;contractedplan.plan.name == 'association_fee''</tt><br><tt>&nbsp;instance.active</tt>", max_length=256, blank=True)), ('match', models.CharField(max_length=256, blank=True, help_text="Python <a href='https://docs.python.org/2/library/functions.html#eval'>expression</a> that designates wheter a <tt>content_type</tt> object is related to this service or not, always evaluates <tt>True</tt> when left blank. Related instance can be instantiated with <tt>instance</tt> keyword or <tt>content_type.model_name</tt>.</br><tt>&nbsp;databaseuser.type == 'MYSQL'</tt><br><tt>&nbsp;miscellaneous.active and str(miscellaneous.identifier).endswith(('.org', '.net', '.com'))</tt><br><tt>&nbsp;contractedplan.plan.name == 'association_fee''</tt><br><tt>&nbsp;instance.active</tt>", verbose_name='match')),
('handler_type', models.CharField(verbose_name='handler', help_text='Handler used for processing this Service. A handler enables customized behaviour far beyond what options here allow to.', max_length=256, blank=True, choices=[('', 'Default')])), ('handler_type', models.CharField(max_length=256, blank=True, help_text='Handler used for processing this Service. A handler enables customized behaviour far beyond what options here allow to.', verbose_name='handler', choices=[('', 'Default')])),
('is_active', models.BooleanField(verbose_name='active', default=True)), ('is_active', models.BooleanField(default=True, verbose_name='active')),
('ignore_superusers', models.BooleanField(verbose_name='ignore superuser, staff and friend', help_text='Designates whether superuser, staff and friend orders are marked as ignored by default or not.', default=True)), ('ignore_superusers', models.BooleanField(help_text='Designates whether superuser, staff and friend orders are marked as ignored by default or not.', default=True, verbose_name='ignore superuser, staff and friend')),
('billing_period', models.CharField(verbose_name='billing period', help_text='Renewal period for recurring invoicing.', blank=True, choices=[('', 'One time service'), ('MONTHLY', 'Monthly billing'), ('ANUAL', 'Anual billing')], max_length=16, default='ANUAL')), ('billing_period', models.CharField(max_length=16, verbose_name='billing period', blank=True, help_text='Renewal period for recurring invoicing.', default='ANUAL', choices=[('', 'One time service'), ('MONTHLY', 'Monthly billing'), ('ANUAL', 'Anual billing')])),
('billing_point', models.CharField(verbose_name='billing point', help_text='Reference point for calculating the renewal date on recurring invoices', max_length=16, default='ON_FIXED_DATE', choices=[('ON_REGISTER', 'Registration date'), ('ON_FIXED_DATE', 'Fixed billing date')])), ('billing_point', models.CharField(max_length=16, help_text='Reference point for calculating the renewal date on recurring invoices', verbose_name='billing point', default='ON_FIXED_DATE', choices=[('ON_REGISTER', 'Registration date'), ('ON_FIXED_DATE', 'Fixed billing date')])),
('is_fee', models.BooleanField(verbose_name='fee', help_text='Designates whether this service should be billed as membership fee or not', default=False)), ('is_fee', models.BooleanField(help_text='Designates whether this service should be billed as membership fee or not', default=False, verbose_name='fee')),
('order_description', models.CharField(verbose_name='Order description', help_text="Python <a href='https://docs.python.org/2/library/functions.html#eval'>expression</a> used for generating the description for the bill lines of this services.<br>Defaults to <tt>'%s: %s' % (handler.description, instance)</tt>", max_length=128, blank=True)), ('order_description', models.CharField(max_length=128, blank=True, help_text="Python <a href='https://docs.python.org/2/library/functions.html#eval'>expression</a> used for generating the description for the bill lines of this services.<br>Defaults to <tt>'%s: %s' % (ugettext(handler.description), instance)</tt>", verbose_name='Order description')),
('ignore_period', models.CharField(verbose_name='ignore period', help_text='Period in which orders will be ignored if cancelled. Useful for designating <i>trial periods</i>', blank=True, choices=[('', 'Never'), ('ONE_DAY', 'One day'), ('TWO_DAYS', 'Two days'), ('TEN_DAYS', 'Ten days'), ('ONE_MONTH', 'One month')], max_length=16, default='TEN_DAYS')), ('ignore_period', models.CharField(max_length=16, verbose_name='ignore period', blank=True, help_text='Period in which orders will be ignored if cancelled. Useful for designating <i>trial periods</i>', default='TEN_DAYS', choices=[('', 'Never'), ('ONE_DAY', 'One day'), ('TWO_DAYS', 'Two days'), ('TEN_DAYS', 'Ten days'), ('ONE_MONTH', 'One month')])),
('metric', models.CharField(verbose_name='metric', help_text="Python <a href='https://docs.python.org/2/library/functions.html#eval'>expression</a> used for obtinging the <i>metric value</i> for the pricing rate computation. Number of orders is used when left blank. Related instance can be instantiated with <tt>instance</tt> keyword or <tt>content_type.model_name</tt>.<br><tt>&nbsp;max((mailbox.resources.disk.allocated or 0) -1, 0)</tt><br><tt>&nbsp;miscellaneous.amount</tt><br><tt>&nbsp;max((account.resources.traffic.used or 0) - getattr(account.miscellaneous.filter(is_active=True, service__name='traffic-prepay').last(), 'amount', 0), 0)</tt>", max_length=256, blank=True)), ('metric', models.CharField(max_length=256, blank=True, help_text="Python <a href='https://docs.python.org/2/library/functions.html#eval'>expression</a> used for obtinging the <i>metric value</i> for the pricing rate computation. Number of orders is used when left blank. Related instance can be instantiated with <tt>instance</tt> keyword or <tt>content_type.model_name</tt>.<br><tt>&nbsp;max((mailbox.resources.disk.allocated or 0) -1, 0)</tt><br><tt>&nbsp;miscellaneous.amount</tt><br><tt>&nbsp;max((account.resources.traffic.used or 0) - getattr(account.miscellaneous.filter(is_active=True, service__name='traffic-prepay').last(), 'amount', 0), 0)</tt>", verbose_name='metric')),
('nominal_price', models.DecimalField(verbose_name='nominal price', max_digits=12, decimal_places=2)), ('nominal_price', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='nominal price')),
('tax', models.PositiveIntegerField(verbose_name='tax', choices=[(0, 'Duty free'), (21, '21%')], default=21)), ('tax', models.PositiveIntegerField(verbose_name='tax', default=21, choices=[(0, 'Duty free'), (21, '21%')])),
('pricing_period', models.CharField(verbose_name='pricing period', help_text='Time period that is used for computing the rate metric.', blank=True, choices=[('', 'Current value'), ('BILLING_PERIOD', 'Same as billing period'), ('MONTHLY', 'Monthly data'), ('ANUAL', 'Anual data')], max_length=16, default='BILLING_PERIOD')), ('pricing_period', models.CharField(max_length=16, verbose_name='pricing period', blank=True, help_text='Time period that is used for computing the rate metric.', default='BILLING_PERIOD', choices=[('', 'Current value'), ('BILLING_PERIOD', 'Same as billing period'), ('MONTHLY', 'Monthly data'), ('ANUAL', 'Anual data')])),
('rate_algorithm', models.CharField(verbose_name='rate algorithm', help_text='Algorithm used to interprete the rating table.<br>&nbsp;&nbsp;Step price: All price rates with a lower metric are applied.<br>&nbsp;&nbsp;Match price: Only the rate with inmediate inferior metric is applied.', max_length=16, default='STEP_PRICE', choices=[('STEP_PRICE', 'Step price'), ('MATCH_PRICE', 'Match price')])), ('rate_algorithm', models.CharField(max_length=16, help_text='Algorithm used to interprete the rating table.<br>&nbsp;&nbsp;Step price: All rates with a quantity lower than the metric are applied. Nominal price will be used when initial block is missing.<br>&nbsp;&nbsp;Match price: Only <b>the rate</b> with a) inmediate inferior metric and b) lower price is applied. Nominal price will be used when initial block is missing.', verbose_name='rate algorithm', default='STEP_PRICE', choices=[('STEP_PRICE', 'Step price'), ('MATCH_PRICE', 'Match price')])),
('on_cancel', models.CharField(verbose_name='on cancel', help_text='Defines the cancellation behaviour of this service.', max_length=16, default='DISCOUNT', choices=[('NOTHING', 'Nothing'), ('DISCOUNT', 'Discount'), ('COMPENSATE', 'Compensat'), ('REFUND', 'Refund')])), ('on_cancel', models.CharField(max_length=16, help_text='Defines the cancellation behaviour of this service.', verbose_name='on cancel', default='DISCOUNT', choices=[('NOTHING', 'Nothing'), ('DISCOUNT', 'Discount'), ('COMPENSATE', 'Compensat'), ('REFUND', 'Refund')])),
('payment_style', models.CharField(verbose_name='payment style', help_text='Designates whether this service should be paid after consumtion (postpay/on demand) or prepaid.', max_length=16, default='PREPAY', choices=[('PREPAY', 'Prepay'), ('POSTPAY', 'Postpay (on demand)')])), ('payment_style', models.CharField(max_length=16, help_text='Designates whether this service should be paid after consumtion (postpay/on demand) or prepaid.', verbose_name='payment style', default='PREPAY', choices=[('PREPAY', 'Prepay'), ('POSTPAY', 'Postpay (on demand)')])),
('content_type', models.ForeignKey(verbose_name='content type', help_text='Content type of the related service objects.', to='contenttypes.ContentType')), ('content_type', models.ForeignKey(to='contenttypes.ContentType', help_text='Content type of the related service objects.', verbose_name='content type')),
], ],
), ),
] ]

View File

@ -0,0 +1 @@
default_app_config = 'orchestra.contrib.systemusers.apps.SystemUsersConfig'

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class SystemUsersConfig(AppConfig):
name = 'orchestra.contrib.systemusers'
verbose_name = "System users"

View File

@ -2,28 +2,28 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import orchestra.core.validators
from django.conf import settings from django.conf import settings
import orchestra.core.validators
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('orders', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='SystemUser', name='SystemUser',
fields=[ fields=[
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('username', models.CharField(validators=[orchestra.core.validators.validate_username], unique=True, help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', max_length=32, verbose_name='username')), ('username', models.CharField(verbose_name='username', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', validators=[orchestra.core.validators.validate_username], max_length=32, unique=True)),
('password', models.CharField(max_length=128, verbose_name='password')), ('password', models.CharField(max_length=128, verbose_name='password')),
('home', models.CharField(max_length=256, help_text='Starting location when login with this no-shell user.', blank=True, verbose_name='home')), ('home', models.CharField(verbose_name='home', help_text='Starting location when login with this no-shell user.', blank=True, max_length=256)),
('directory', models.CharField(max_length=256, help_text="Optional directory relative to user's home.", blank=True, verbose_name='directory')), ('directory', models.CharField(verbose_name='directory', help_text="Optional directory relative to user's home.", blank=True, max_length=256)),
('shell', models.CharField(default='/dev/null', choices=[('/dev/null', 'No shell, FTP only'), ('/bin/rssh', 'No shell, SFTP/RSYNC only'), ('/bin/bash', '/bin/bash'), ('/bin/sh', '/bin/sh')], max_length=32, verbose_name='shell')), ('shell', models.CharField(verbose_name='shell', choices=[('/dev/null', 'No shell, FTP only'), ('/bin/rssh', 'No shell, SFTP/RSYNC only'), ('/bin/bash', '/bin/bash'), ('/bin/sh', '/bin/sh')], default='/dev/null', max_length=32)),
('is_active', models.BooleanField(default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)),
# ('account', models.ForeignKey(related_name='systemusers', to=settings.AUTH_USER_MODEL, verbose_name='Account')), ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='systemusers', verbose_name='Account')),
('groups', models.ManyToManyField(help_text='A new group will be created for the user. Which additional groups would you like them to be a member of?', blank=True, to='systemusers.SystemUser')), ('groups', models.ManyToManyField(help_text='A new group will be created for the user. Which additional groups would you like them to be a member of?', blank=True, to='systemusers.SystemUser')),
], ],
), ),

View File

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('systemusers', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='systemuser',
name='account',
field=models.ForeignKey(related_name='systemusers', to=settings.AUTH_USER_MODEL, default=1, verbose_name='Account'),
preserve_default=False,
),
]

View File

@ -16,16 +16,16 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='VPS', name='VPS',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, primary_key=True, auto_created=True)), ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('hostname', models.CharField(verbose_name='hostname', max_length=256, validators=[orchestra.core.validators.validate_hostname], unique=True)), ('hostname', models.CharField(unique=True, max_length=256, validators=[orchestra.core.validators.validate_hostname], verbose_name='hostname')),
('type', models.CharField(default='openvz', verbose_name='type', max_length=64, choices=[('openvz', 'OpenVZ container')])), ('type', models.CharField(max_length=64, choices=[('openvz', 'OpenVZ container')], verbose_name='type', default='openvz')),
('template', models.CharField(default='debian7', verbose_name='template', max_length=64, choices=[('debian7', 'Debian 7 - Wheezy')])), ('template', models.CharField(max_length=64, choices=[('debian7', 'Debian 7 - Wheezy')], verbose_name='template', default='debian7')),
('password', models.CharField(verbose_name='password', help_text='<TT>root</TT> password of this virtual machine', max_length=128)), ('password', models.CharField(max_length=128, help_text='<TT>root</TT> password of this virtual machine', verbose_name='password')),
('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', related_name='vpss')), ('account', models.ForeignKey(related_name='vpss', to=settings.AUTH_USER_MODEL, verbose_name='Account')),
], ],
options={ options={
'verbose_name': 'VPS',
'verbose_name_plural': 'VPSs', 'verbose_name_plural': 'VPSs',
'verbose_name': 'VPS',
}, },
), ),
] ]

View File

@ -2,9 +2,9 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import jsonfield.fields
import orchestra.core.validators
from django.conf import settings from django.conf import settings
import orchestra.core.validators
import jsonfield.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -17,28 +17,28 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='WebApp', name='WebApp',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='name', max_length=128)), ('name', models.CharField(max_length=128, validators=[orchestra.core.validators.validate_name], help_text='The app will be installed in %(home)s/webapps/%(app_name)s', verbose_name='name')),
('type', models.CharField(verbose_name='type', choices=[('php', 'PHP'), ('static', 'Static'), ('symbolic-link', 'Symbolic link'), ('webalizer', 'Webalizer'), ('wordpress-php', 'WordPress')], max_length=32)), ('type', models.CharField(max_length=32, choices=[('php', 'PHP'), ('python', 'Python'), ('static', 'Static'), ('symbolic-link', 'Symbolic link'), ('webalizer', 'Webalizer'), ('wordpress-php', 'WordPress')], verbose_name='type')),
('data', jsonfield.fields.JSONField(blank=True, verbose_name='data', help_text='Extra information dependent of each service.', default={})), ('data', jsonfield.fields.JSONField(verbose_name='data', help_text='Extra information dependent of each service.', blank=True, default={})),
('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', related_name='webapps')), ('account', models.ForeignKey(related_name='webapps', to=settings.AUTH_USER_MODEL, verbose_name='Account')),
], ],
options={ options={
'verbose_name_plural': 'Web Apps',
'verbose_name': 'Web App', 'verbose_name': 'Web App',
'verbose_name_plural': 'Web Apps',
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='WebAppOption', name='WebAppOption',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('name', models.CharField(verbose_name='name', choices=[(None, '-------'), ('FileSystem', [('public-root', 'Public root')]), ('Process', [('timeout', 'Process timeout'), ('processes', 'Number of processes')]), ('PHP', [('enabled_functions', 'Enabled functions'), ('allow_url_include', 'Allow URL include'), ('allow_url_fopen', 'Allow URL fopen'), ('auto_append_file', 'Auto append file'), ('auto_prepend_file', 'Auto prepend file'), ('date.timezone', 'date.timezone'), ('default_socket_timeout', 'Default socket timeout'), ('display_errors', 'Display errors'), ('extension', 'Extension'), ('magic_quotes_gpc', 'Magic quotes GPC'), ('magic_quotes_runtime', 'Magic quotes runtime'), ('magic_quotes_sybase', 'Magic quotes sybase'), ('max_execution_time', 'Max execution time'), ('max_input_time', 'Max input time'), ('max_input_vars', 'Max input vars'), ('memory_limit', 'Memory limit'), ('mysql.connect_timeout', 'Mysql connect timeout'), ('output_buffering', 'Output buffering'), ('register_globals', 'Register globals'), ('post_max_size', 'Post max size'), ('sendmail_path', 'sendmail_path'), ('session.bug_compat_warn', 'session.bug_compat_warn'), ('session.auto_start', 'session.auto_start'), ('safe_mode', 'Safe mode'), ('suhosin.post.max_vars', 'Suhosin POST max vars'), ('suhosin.get.max_vars', 'Suhosin GET max vars'), ('suhosin.request.max_vars', 'Suhosin request max vars'), ('suhosin.session.encrypt', 'suhosin.session.encrypt'), ('suhosin.simulation', 'Suhosin simulation'), ('suhosin.executor.include.whitelist', 'suhosin.executor.include.whitelist'), ('upload_max_filesize', 'upload_max_filesize'), ('zend_extension', 'Zend extension')])], max_length=128)), ('name', models.CharField(max_length=128, choices=[(None, '-------'), ('FileSystem', [('public-root', 'Public root')]), ('Process', [('timeout', 'Process timeout'), ('processes', 'Number of processes')]), ('PHP', [('enable_functions', 'Enable functions'), ('allow_url_include', 'Allow URL include'), ('allow_url_fopen', 'Allow URL fopen'), ('auto_append_file', 'Auto append file'), ('auto_prepend_file', 'Auto prepend file'), ('date.timezone', 'date.timezone'), ('default_socket_timeout', 'Default socket timeout'), ('display_errors', 'Display errors'), ('extension', 'Extension'), ('magic_quotes_gpc', 'Magic quotes GPC'), ('magic_quotes_runtime', 'Magic quotes runtime'), ('magic_quotes_sybase', 'Magic quotes sybase'), ('max_input_time', 'Max input time'), ('max_input_vars', 'Max input vars'), ('memory_limit', 'Memory limit'), ('mysql.connect_timeout', 'Mysql connect timeout'), ('output_buffering', 'Output buffering'), ('register_globals', 'Register globals'), ('post_max_size', 'Post max size'), ('sendmail_path', 'Sendmail path'), ('session.bug_compat_warn', 'Session bug compat warning'), ('session.auto_start', 'Session auto start'), ('safe_mode', 'Safe mode'), ('suhosin.post.max_vars', 'Suhosin POST max vars'), ('suhosin.get.max_vars', 'Suhosin GET max vars'), ('suhosin.request.max_vars', 'Suhosin request max vars'), ('suhosin.session.encrypt', 'Suhosin session encrypt'), ('suhosin.simulation', 'Suhosin simulation'), ('suhosin.executor.include.whitelist', 'Suhosin executor include whitelist'), ('upload_max_filesize', 'Upload max filesize'), ('zend_extension', 'Zend extension')])], verbose_name='name')),
('value', models.CharField(max_length=256, verbose_name='value')), ('value', models.CharField(max_length=256, verbose_name='value')),
('webapp', models.ForeignKey(to='webapps.WebApp', verbose_name='Web application', related_name='options')), ('webapp', models.ForeignKey(related_name='options', to='webapps.WebApp', verbose_name='Web application')),
], ],
options={ options={
'verbose_name_plural': 'options',
'verbose_name': 'option', 'verbose_name': 'option',
'verbose_name_plural': 'options',
}, },
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(

View File

@ -1,30 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import orchestra.core.validators
class Migration(migrations.Migration):
dependencies = [
('webapps', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='webapp',
name='name',
field=models.CharField(validators=[orchestra.core.validators.validate_name], max_length=128, verbose_name='name', help_text='The app will be installed in %(home)s/webapps/%(app_name)s'),
),
migrations.AlterField(
model_name='webapp',
name='type',
field=models.CharField(max_length=32, verbose_name='type', choices=[('php', 'PHP'), ('python', 'Python'), ('static', 'Static'), ('symbolic-link', 'Symbolic link'), ('webalizer', 'Webalizer'), ('wordpress-php', 'WordPress')]),
),
migrations.AlterField(
model_name='webappoption',
name='name',
field=models.CharField(max_length=128, verbose_name='name', choices=[(None, '-------'), ('FileSystem', [('public-root', 'Public root')]), ('Process', [('timeout', 'Process timeout'), ('processes', 'Number of processes')]), ('PHP', [('enable_functions', 'Enable functions'), ('allow_url_include', 'Allow URL include'), ('allow_url_fopen', 'Allow URL fopen'), ('auto_append_file', 'Auto append file'), ('auto_prepend_file', 'Auto prepend file'), ('date.timezone', 'date.timezone'), ('default_socket_timeout', 'Default socket timeout'), ('display_errors', 'Display errors'), ('extension', 'Extension'), ('magic_quotes_gpc', 'Magic quotes GPC'), ('magic_quotes_runtime', 'Magic quotes runtime'), ('magic_quotes_sybase', 'Magic quotes sybase'), ('max_input_time', 'Max input time'), ('max_input_vars', 'Max input vars'), ('memory_limit', 'Memory limit'), ('mysql.connect_timeout', 'Mysql connect timeout'), ('output_buffering', 'Output buffering'), ('register_globals', 'Register globals'), ('post_max_size', 'Post max size'), ('sendmail_path', 'Sendmail path'), ('session.bug_compat_warn', 'Session bug compat warning'), ('session.auto_start', 'Session auto start'), ('safe_mode', 'Safe mode'), ('suhosin.post.max_vars', 'Suhosin POST max vars'), ('suhosin.get.max_vars', 'Suhosin GET max vars'), ('suhosin.request.max_vars', 'Suhosin request max vars'), ('suhosin.session.encrypt', 'Suhosin session encrypt'), ('suhosin.simulation', 'Suhosin simulation'), ('suhosin.executor.include.whitelist', 'Suhosin executor include whitelist'), ('upload_max_filesize', 'Upload max filesize'), ('zend_extension', 'Zend extension')])]),
),
]

View File

@ -9,8 +9,8 @@ from django.conf import settings
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('webapps', '0001_initial'), ('webapps', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('domains', '0001_initial'), ('domains', '0001_initial'),
] ]
@ -19,35 +19,35 @@ class Migration(migrations.Migration):
name='Content', name='Content',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
('path', models.CharField(verbose_name='path', blank=True, max_length=256, validators=[orchestra.core.validators.validate_url_path])), ('path', models.CharField(verbose_name='path', validators=[orchestra.core.validators.validate_url_path], blank=True, max_length=256)),
('webapp', models.ForeignKey(to='webapps.WebApp', verbose_name='web application')), ('webapp', models.ForeignKey(verbose_name='web application', to='webapps.WebApp')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Website', name='Website',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=128, validators=[orchestra.core.validators.validate_name])), ('name', models.CharField(verbose_name='name', validators=[orchestra.core.validators.validate_name], max_length=128)),
('protocol', models.CharField(default='http', verbose_name='protocol', max_length=16, help_text='Select the protocol(s) for this website<br><tt>HTTPS only</tt> performs a redirection from <tt>http</tt> to <tt>https</tt>.', choices=[('http', 'HTTP'), ('https', 'HTTPS'), ('http/https', 'HTTP and HTTPS'), ('https-only', 'HTTPS only')])), ('protocol', models.CharField(verbose_name='protocol', default='http', choices=[('http', 'HTTP'), ('https', 'HTTPS'), ('http/https', 'HTTP and HTTPS'), ('https-only', 'HTTPS only')], help_text='Select the protocol(s) for this website<br><tt>HTTPS only</tt> performs a redirection from <tt>http</tt> to <tt>https</tt>.', max_length=16)),
('is_active', models.BooleanField(verbose_name='active', default=True)), ('is_active', models.BooleanField(verbose_name='active', default=True)),
('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='websites', verbose_name='Account')), ('account', models.ForeignKey(verbose_name='Account', related_name='websites', to=settings.AUTH_USER_MODEL)),
('contents', models.ManyToManyField(to='webapps.WebApp', through='websites.Content')), ('contents', models.ManyToManyField(to='webapps.WebApp', through='websites.Content')),
('domains', models.ManyToManyField(to='domains.Domain', verbose_name='domains', related_name='websites')), ('domains', models.ManyToManyField(verbose_name='domains', to='domains.Domain', related_name='websites')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='WebsiteDirective', name='WebsiteDirective',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=128, choices=[(None, '-------'), ('SaaS', [('wordpress-saas', 'WordPress SaaS'), ('dokuwiki-saas', 'DokuWiki SaaS'), ('drupal-saas', 'Drupdal SaaS')]), ('ModSecurity', [('sec-rule-remove', 'SecRuleRemoveById'), ('sec-engine', 'SecRuleEngine Off')]), ('HTTPD', [('redirect', 'Redirection'), ('proxy', 'Proxy'), ('error-document', 'ErrorDocumentRoot')]), ('SSL', [('ssl-ca', 'SSL CA'), ('ssl-cert', 'SSL cert'), ('ssl-key', 'SSL key')])])), ('name', models.CharField(verbose_name='name', choices=[(None, '-------'), ('ModSecurity', [('sec-rule-remove', 'SecRuleRemoveById'), ('sec-engine', 'SecRuleEngine Off')]), ('SSL', [('ssl-ca', 'SSL CA'), ('ssl-cert', 'SSL cert'), ('ssl-key', 'SSL key')]), ('HTTPD', [('redirect', 'Redirection'), ('proxy', 'Proxy'), ('error-document', 'ErrorDocumentRoot')]), ('SaaS', [('wordpress-saas', 'WordPress SaaS'), ('dokuwiki-saas', 'DokuWiki SaaS'), ('drupal-saas', 'Drupdal SaaS')])], max_length=128)),
('value', models.CharField(verbose_name='value', max_length=256)), ('value', models.CharField(verbose_name='value', max_length=256)),
('website', models.ForeignKey(to='websites.Website', related_name='directives', verbose_name='web site')), ('website', models.ForeignKey(verbose_name='web site', related_name='directives', to='websites.Website')),
], ],
), ),
migrations.AddField( migrations.AddField(
model_name='content', model_name='content',
name='website', name='website',
field=models.ForeignKey(to='websites.Website', verbose_name='web site'), field=models.ForeignKey(verbose_name='web site', to='websites.Website'),
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
name='website', name='website',