Commit 3d40e5f4 by Bach Dániel

Merge branch 'feature-django-1.7'

Conflicts:
	circle/dashboard/forms.py
parents 892f1470 f8759446
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime from __future__ import unicode_literals
from south.db import db
from south.v2 import SchemaMigration from django.db import models, migrations
from django.db import models from django.conf import settings
class Migration(SchemaMigration): class Migration(migrations.Migration):
def forwards(self, orm): dependencies = [
# Adding model 'Level' ('auth', '0001_initial'),
db.create_table(u'acl_level', ( migrations.swappable_dependency(settings.AUTH_USER_MODEL),
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('contenttypes', '0001_initial'),
('name', self.gf('django.db.models.fields.CharField')(max_length=50)), ]
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
('codename', self.gf('django.db.models.fields.CharField')(max_length=100)), operations = [
('weight', self.gf('django.db.models.fields.IntegerField')(null=True)), migrations.CreateModel(
)) name='Level',
db.send_create_signal(u'acl', ['Level']) fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
# Adding unique constraint on 'Level', fields ['content_type', 'codename'] ('name', models.CharField(max_length=50, verbose_name=b'name')),
db.create_unique(u'acl_level', ['content_type_id', 'codename']) ('codename', models.CharField(max_length=100, verbose_name=b'codename')),
('weight', models.IntegerField(null=True, verbose_name=b'weight')),
# Adding model 'ObjectLevel' ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
db.create_table(u'acl_objectlevel', ( ],
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), options={
('level', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['acl.Level'])),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
('object_id', self.gf('django.db.models.fields.CharField')(max_length=255)),
))
db.send_create_signal(u'acl', ['ObjectLevel'])
# Adding unique constraint on 'ObjectLevel', fields ['content_type', 'object_id', 'level']
db.create_unique(u'acl_objectlevel', ['content_type_id', 'object_id', 'level_id'])
# Adding M2M table for field users on 'ObjectLevel'
m2m_table_name = db.shorten_name(u'acl_objectlevel_users')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('objectlevel', models.ForeignKey(orm[u'acl.objectlevel'], null=False)),
('user', models.ForeignKey(orm[u'auth.user'], null=False))
))
db.create_unique(m2m_table_name, ['objectlevel_id', 'user_id'])
# Adding M2M table for field groups on 'ObjectLevel'
m2m_table_name = db.shorten_name(u'acl_objectlevel_groups')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('objectlevel', models.ForeignKey(orm[u'acl.objectlevel'], null=False)),
('group', models.ForeignKey(orm[u'auth.group'], null=False))
))
db.create_unique(m2m_table_name, ['objectlevel_id', 'group_id'])
def backwards(self, orm):
# Removing unique constraint on 'ObjectLevel', fields ['content_type', 'object_id', 'level']
db.delete_unique(u'acl_objectlevel', ['content_type_id', 'object_id', 'level_id'])
# Removing unique constraint on 'Level', fields ['content_type', 'codename']
db.delete_unique(u'acl_level', ['content_type_id', 'codename'])
# Deleting model 'Level'
db.delete_table(u'acl_level')
# Deleting model 'ObjectLevel'
db.delete_table(u'acl_objectlevel')
# Removing M2M table for field users on 'ObjectLevel'
db.delete_table(db.shorten_name(u'acl_objectlevel_users'))
# Removing M2M table for field groups on 'ObjectLevel'
db.delete_table(db.shorten_name(u'acl_objectlevel_groups'))
models = {
u'acl.level': {
'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Level'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
},
u'acl.objectlevel': {
'Meta': {'unique_together': "(('content_type', 'object_id', 'level'),)", 'object_name': 'ObjectLevel'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'level': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Level']"}),
'object_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'})
},
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
}, },
u'auth.permission': { bases=(models.Model,),
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, ),
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), migrations.CreateModel(
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), name='ObjectLevel',
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), fields=[
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('object_id', models.IntegerField()),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('groups', models.ManyToManyField(to='auth.Group')),
('level', models.ForeignKey(to='acl.Level')),
('users', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
],
options={
}, },
u'auth.user': { bases=(models.Model,),
'Meta': {'object_name': 'User'}, ),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), migrations.AlterUniqueTogether(
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), name='objectlevel',
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), unique_together=set([('content_type', 'object_id', 'level')]),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), ),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.AlterUniqueTogether(
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), name='level',
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), unique_together=set([('content_type', 'codename')]),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), ]
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['acl']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Level'
db.create_table(u'acl_level', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=50)),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
('codename', self.gf('django.db.models.fields.CharField')(max_length=100)),
('weight', self.gf('django.db.models.fields.IntegerField')(null=True)),
))
db.send_create_signal(u'acl', ['Level'])
# Adding unique constraint on 'Level', fields ['content_type', 'codename']
db.create_unique(u'acl_level', ['content_type_id', 'codename'])
# Adding model 'ObjectLevel'
db.create_table(u'acl_objectlevel', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('level', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['acl.Level'])),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
('object_id', self.gf('django.db.models.fields.CharField')(max_length=255)),
))
db.send_create_signal(u'acl', ['ObjectLevel'])
# Adding unique constraint on 'ObjectLevel', fields ['content_type', 'object_id', 'level']
db.create_unique(u'acl_objectlevel', ['content_type_id', 'object_id', 'level_id'])
# Adding M2M table for field users on 'ObjectLevel'
m2m_table_name = db.shorten_name(u'acl_objectlevel_users')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('objectlevel', models.ForeignKey(orm[u'acl.objectlevel'], null=False)),
('user', models.ForeignKey(orm[u'auth.user'], null=False))
))
db.create_unique(m2m_table_name, ['objectlevel_id', 'user_id'])
# Adding M2M table for field groups on 'ObjectLevel'
m2m_table_name = db.shorten_name(u'acl_objectlevel_groups')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('objectlevel', models.ForeignKey(orm[u'acl.objectlevel'], null=False)),
('group', models.ForeignKey(orm[u'auth.group'], null=False))
))
db.create_unique(m2m_table_name, ['objectlevel_id', 'group_id'])
def backwards(self, orm):
# Removing unique constraint on 'ObjectLevel', fields ['content_type', 'object_id', 'level']
db.delete_unique(u'acl_objectlevel', ['content_type_id', 'object_id', 'level_id'])
# Removing unique constraint on 'Level', fields ['content_type', 'codename']
db.delete_unique(u'acl_level', ['content_type_id', 'codename'])
# Deleting model 'Level'
db.delete_table(u'acl_level')
# Deleting model 'ObjectLevel'
db.delete_table(u'acl_objectlevel')
# Removing M2M table for field users on 'ObjectLevel'
db.delete_table(db.shorten_name(u'acl_objectlevel_users'))
# Removing M2M table for field groups on 'ObjectLevel'
db.delete_table(db.shorten_name(u'acl_objectlevel_groups'))
models = {
u'acl.level': {
'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Level'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
},
u'acl.objectlevel': {
'Meta': {'unique_together': "(('content_type', 'object_id', 'level'),)", 'object_name': 'ObjectLevel'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'level': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Level']"}),
'object_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'})
},
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['acl']
\ No newline at end of file
...@@ -15,29 +15,4 @@ ...@@ -15,29 +15,4 @@
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with CIRCLE. If not, see <http://www.gnu.org/licenses/>. # with CIRCLE. If not, see <http://www.gnu.org/licenses/>.
from django.db.models import TextField, ForeignKey from .test_acl import TestModel, Test2Model # noqa
from django.contrib.auth.models import User
from ..models import AclBase
class TestModel(AclBase):
normal_field = TextField()
ACL_LEVELS = (
('alfa', 'Alfa'),
('bravo', 'Bravo'),
('charlie', 'Charlie'),
)
class Test2Model(AclBase):
normal2_field = TextField()
owner = ForeignKey(User, null=True)
ACL_LEVELS = (
('one', 'One'),
('two', 'Two'),
('three', 'Three'),
('owner', 'owner'),
)
...@@ -17,9 +17,31 @@ ...@@ -17,9 +17,31 @@
from django.test import TestCase from django.test import TestCase
from django.contrib.auth.models import User, Group, AnonymousUser from django.contrib.auth.models import User, Group, AnonymousUser
from django.db.models import TextField, ForeignKey
from ..models import ObjectLevel from ..models import ObjectLevel, AclBase
from .models import TestModel, Test2Model
class TestModel(AclBase):
normal_field = TextField()
ACL_LEVELS = (
('alfa', 'Alfa'),
('bravo', 'Bravo'),
('charlie', 'Charlie'),
)
class Test2Model(AclBase):
normal2_field = TextField()
owner = ForeignKey(User, null=True)
ACL_LEVELS = (
('one', 'One'),
('two', 'Two'),
('three', 'Three'),
('owner', 'owner'),
)
class AclUserTest(TestCase): class AclUserTest(TestCase):
......
...@@ -50,20 +50,20 @@ def get_env_variable(var_name, default=None): ...@@ -50,20 +50,20 @@ def get_env_variable(var_name, default=None):
########## PATH CONFIGURATION ########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory: # Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__))) BASE_DIR = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project folder: # Absolute filesystem path to the top-level project folder:
SITE_ROOT = dirname(DJANGO_ROOT) SITE_ROOT = dirname(BASE_DIR)
# Site name: # Site name:
SITE_NAME = basename(DJANGO_ROOT) SITE_NAME = basename(BASE_DIR)
# Url to site: (e.g. http://localhost:8080/) # Url to site: (e.g. http://localhost:8080/)
DJANGO_URL = get_env_variable('DJANGO_URL', '/') DJANGO_URL = get_env_variable('DJANGO_URL', '/')
# Add our project to our pythonpath, this way we don't need to type our project # Add our project to our pythonpath, this way we don't need to type our project
# name in our dotted import paths: # name in our dotted import paths:
path.append(DJANGO_ROOT) path.append(BASE_DIR)
########## END PATH CONFIGURATION ########## END PATH CONFIGURATION
...@@ -78,14 +78,9 @@ TEMPLATE_DEBUG = DEBUG ...@@ -78,14 +78,9 @@ TEMPLATE_DEBUG = DEBUG
########## MANAGER CONFIGURATION ########## MANAGER CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins # See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = (
('Root', 'root@localhost'),
)
EMAIL_SUBJECT_PREFIX = get_env_variable('DJANGO_SUBJECT_PREFIX', '[CIRCLE] ') EMAIL_SUBJECT_PREFIX = get_env_variable('DJANGO_SUBJECT_PREFIX', '[CIRCLE] ')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
########## END MANAGER CONFIGURATION ########## END MANAGER CONFIGURATION
...@@ -283,12 +278,6 @@ TEMPLATE_CONTEXT_PROCESSORS = ( ...@@ -283,12 +278,6 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'dashboard.context_processors.extract_settings', 'dashboard.context_processors.extract_settings',
) )
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
TEMPLATE_DIRS = ( TEMPLATE_DIRS = (
normpath(join(SITE_ROOT, '../../site-circle/templates')), normpath(join(SITE_ROOT, '../../site-circle/templates')),
...@@ -337,7 +326,6 @@ DJANGO_APPS = ( ...@@ -337,7 +326,6 @@ DJANGO_APPS = (
) )
THIRD_PARTY_APPS = ( THIRD_PARTY_APPS = (
'south',
'django_tables2', 'django_tables2',
'crispy_forms', 'crispy_forms',
'djcelery', 'djcelery',
...@@ -349,6 +337,11 @@ THIRD_PARTY_APPS = ( ...@@ -349,6 +337,11 @@ THIRD_PARTY_APPS = (
'pipeline', 'pipeline',
) )
import django
if django.get_version() < '1.7':
THIRD_PARTY_APPS += 'south',
# Apps specific for this project go here. # Apps specific for this project go here.
LOCAL_APPS = ( LOCAL_APPS = (
'common', 'common',
...@@ -533,8 +526,14 @@ LOCALE_PATHS = (join(SITE_ROOT, 'locale'), ) ...@@ -533,8 +526,14 @@ LOCALE_PATHS = (join(SITE_ROOT, 'locale'), )
COMPANY_NAME = "BME IK 2014" COMPANY_NAME = "BME IK 2014"
SOUTH_MIGRATION_MODULES = { SOUTH_MIGRATION_MODULES = {
'taggit': 'taggit.south_migrations', 'taggit': 'taggit.south_migrations',
'vm': 'vm.south_migrations',
'firewall': 'firewall.south_migrations',
'acl': 'acl.south_migrations',
'dashboard': 'dashboard.south_migrations',
'storage': 'storage.south_migrations',
} }
graphite_host = environ.get("GRAPHITE_HOST", None) graphite_host = environ.get("GRAPHITE_HOST", None)
graphite_port = environ.get("GRAPHITE_PORT", None) graphite_port = environ.get("GRAPHITE_PORT", None)
if graphite_host and graphite_port: if graphite_host and graphite_port:
......
...@@ -43,7 +43,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' ...@@ -43,7 +43,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# DATABASES = { # DATABASES = {
# 'default': { # 'default': {
# 'ENGINE': 'django.db.backends.sqlite3', # 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': normpath(join(DJANGO_ROOT, 'default.db')), # 'NAME': normpath(join(BASE_DIR, 'default.db')),
# 'USER': '', # 'USER': '',
# 'PASSWORD': '', # 'PASSWORD': '',
# 'HOST': '', # 'HOST': '',
......
...@@ -370,6 +370,12 @@ class HumanSortField(CharField): ...@@ -370,6 +370,12 @@ class HumanSortField(CharField):
def get_monitored_value(self, instance): def get_monitored_value(self, instance):
return getattr(instance, self.monitor) return getattr(instance, self.monitor)
def deconstruct(self):
name, path, args, kwargs = super(HumanSortField, self).deconstruct()
if self.monitor is not None:
kwargs['monitor'] = self.monitor
return name, path, args, kwargs
@staticmethod @staticmethod
def _partition(s, pred): def _partition(s, pred):
"""Partition a deque of chars to a tuple of a """Partition a deque of chars to a tuple of a
......
...@@ -96,10 +96,10 @@ class VmSaveForm(OperationForm): ...@@ -96,10 +96,10 @@ class VmSaveForm(OperationForm):
if default: if default:
self.fields['name'].initial = default self.fields['name'].initial = default
if clone: if clone:
self.fields.insert(2, "clone", forms.BooleanField( self.fields["clone"] = forms.BooleanField(
required=False, label=_("Clone template permissions"), required=False, label=_("Clone template permissions"),
help_text=_("Clone the access list of parent template. Useful " help_text=_("Clone the access list of parent template. Useful "
"for updating a template."))) "for updating a template."))
class VmCustomizeForm(forms.Form): class VmCustomizeForm(forms.Form):
...@@ -750,9 +750,9 @@ class VmRenewForm(OperationForm): ...@@ -750,9 +750,9 @@ class VmRenewForm(OperationForm):
default = kwargs.pop('default') default = kwargs.pop('default')
super(VmRenewForm, self).__init__(*args, **kwargs) super(VmRenewForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'lease', forms.ModelChoiceField( self.fields['lease'] = forms.ModelChoiceField(
queryset=choices, initial=default, required=False, queryset=choices, initial=default, required=False,
empty_label=None, label=_('Length'))) empty_label=None, label=_('Length'))
if len(choices) < 2: if len(choices) < 2:
self.fields['lease'].widget = HiddenInput() self.fields['lease'].widget = HiddenInput()
self.fields['save'].widget = HiddenInput() self.fields['save'].widget = HiddenInput()
...@@ -772,9 +772,9 @@ class VmMigrateForm(forms.Form): ...@@ -772,9 +772,9 @@ class VmMigrateForm(forms.Form):
default = kwargs.pop('default') default = kwargs.pop('default')
super(VmMigrateForm, self).__init__(*args, **kwargs) super(VmMigrateForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'to_node', forms.ModelChoiceField( self.fields['to_node'] = forms.ModelChoiceField(
queryset=choices, initial=default, required=False, queryset=choices, initial=default, required=False,
widget=forms.RadioSelect(), label=_("Node"))) widget=forms.RadioSelect(), label=_("Node"))
class VmStateChangeForm(OperationForm): class VmStateChangeForm(OperationForm):
...@@ -835,9 +835,9 @@ class VmDiskResizeForm(OperationForm): ...@@ -835,9 +835,9 @@ class VmDiskResizeForm(OperationForm):
super(VmDiskResizeForm, self).__init__(*args, **kwargs) super(VmDiskResizeForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'disk', forms.ModelChoiceField( self.fields['disk'] = forms.ModelChoiceField(
queryset=choices, initial=self.disk, required=True, queryset=choices, initial=self.disk, required=True,
empty_label=None, label=_('Disk'))) empty_label=None, label=_('Disk'))
if self.disk: if self.disk:
self.fields['disk'].widget = HiddenInput() self.fields['disk'].widget = HiddenInput()
self.fields['size'].initial += self.disk.size self.fields['size'].initial += self.disk.size
...@@ -871,9 +871,9 @@ class VmDiskRemoveForm(OperationForm): ...@@ -871,9 +871,9 @@ class VmDiskRemoveForm(OperationForm):
super(VmDiskRemoveForm, self).__init__(*args, **kwargs) super(VmDiskRemoveForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'disk', forms.ModelChoiceField( self.fields['disk'] = forms.ModelChoiceField(
queryset=choices, initial=self.disk, required=True, queryset=choices, initial=self.disk, required=True,
empty_label=None, label=_('Disk'))) empty_label=None, label=_('Disk'))
if self.disk: if self.disk:
self.fields['disk'].widget = HiddenInput() self.fields['disk'].widget = HiddenInput()
...@@ -916,9 +916,9 @@ class VmRemoveInterfaceForm(OperationForm): ...@@ -916,9 +916,9 @@ class VmRemoveInterfaceForm(OperationForm):
super(VmRemoveInterfaceForm, self).__init__(*args, **kwargs) super(VmRemoveInterfaceForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'interface', forms.ModelChoiceField( self.fields['interface'] = forms.ModelChoiceField(
queryset=choices, initial=self.interface, required=True, queryset=choices, initial=self.interface, required=True,
empty_label=None, label=_('Interface'))) empty_label=None, label=_('Interface'))
if self.interface: if self.interface:
self.fields['interface'].widget = HiddenInput() self.fields['interface'].widget = HiddenInput()
...@@ -983,14 +983,14 @@ class VmDeployForm(OperationForm): ...@@ -983,14 +983,14 @@ class VmDeployForm(OperationForm):
super(VmDeployForm, self).__init__(*args, **kwargs) super(VmDeployForm, self).__init__(*args, **kwargs)
if choices is not None: if choices is not None:
self.fields.insert(0, 'node', DeployChoiceField( self.fields['node'] = DeployChoiceField(
queryset=choices, required=False, label=_('Node'), help_text=_( queryset=choices, required=False, label=_('Node'), help_text=_(
"Deploy virtual machine to this node " "Deploy virtual machine to this node "
"(blank allows scheduling automatically)."), "(blank allows scheduling automatically)."),
widget=forms.Select(attrs={ widget=forms.Select(attrs={
'class': "font-awesome-font", 'class': "font-awesome-font",
}), instance=instance }), instance=instance
)) )
class VmPortRemoveForm(OperationForm): class VmPortRemoveForm(OperationForm):
...@@ -1000,9 +1000,9 @@ class VmPortRemoveForm(OperationForm): ...@@ -1000,9 +1000,9 @@ class VmPortRemoveForm(OperationForm):
super(VmPortRemoveForm, self).__init__(*args, **kwargs) super(VmPortRemoveForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'rule', forms.ModelChoiceField( self.fields['rule'] = forms.ModelChoiceField(
queryset=choices, initial=self.rule, required=True, queryset=choices, initial=self.rule, required=True,
empty_label=None, label=_('Port'))) empty_label=None, label=_('Port'))
if self.rule: if self.rule:
self.fields['rule'].widget = HiddenInput() self.fields['rule'].widget = HiddenInput()
...@@ -1019,9 +1019,9 @@ class VmPortAddForm(OperationForm): ...@@ -1019,9 +1019,9 @@ class VmPortAddForm(OperationForm):
super(VmPortAddForm, self).__init__(*args, **kwargs) super(VmPortAddForm, self).__init__(*args, **kwargs)
self.fields.insert(0, 'host', forms.ModelChoiceField( self.fields['host'] = forms.ModelChoiceField(
queryset=choices, initial=self.host, required=True, queryset=choices, initial=self.host, required=True,
empty_label=None, label=_('Host'))) empty_label=None, label=_('Host'))
if self.host: if self.host:
self.fields['host'].widget = HiddenInput() self.fields['host'].widget = HiddenInput()
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime from __future__ import unicode_literals
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.db import models, migrations
import dashboard.validators
import dashboard.models
import model_utils.fields
import sizefield.models
import jsonfield.fields
import django.utils.timezone
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm): class Migration(migrations.Migration):
# Adding model 'Favourite'
db.create_table(u'dashboard_favourite', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('instance', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['vm.Instance'])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal(u'dashboard', ['Favourite'])
dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('vm', '__first__'),
]
def backwards(self, orm): operations = [
# Deleting model 'Favourite' migrations.CreateModel(
db.delete_table(u'dashboard_favourite') name='ConnectCommand',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
models = { ('access_method', models.CharField(help_text='Type of the remote access method.', max_length=10, verbose_name='access method', choices=[('nx', 'NX'), ('rdp', 'RDP'), ('ssh', 'SSH')])),
u'acl.level': { ('name', models.CharField(help_text='Name of your custom command.', max_length=b'128', verbose_name='name')),
'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Level'}, ('template', models.CharField(validators=[dashboard.validators.connect_command_template_validator], max_length=256, blank=True, help_text='Template for connection command string. Available parameters are: username, password, host, port.', null=True, verbose_name='command template')),
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), ('user', models.ForeignKey(related_name='command_set', to=settings.AUTH_USER_MODEL)),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), ],
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), options={
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), },
'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True'}) bases=(models.Model,),
}, ),
u'acl.objectlevel': { migrations.CreateModel(
'Meta': {'unique_together': "(('content_type', 'object_id', 'level'),)", 'object_name': 'ObjectLevel'}, name='Favourite',
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), fields=[
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('instance', models.ForeignKey(to='vm.Instance')),
'level': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Level']"}), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
'object_id': ('django.db.models.fields.IntegerField', [], {}), ],
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'}) options={
}, },
u'auth.group': { bases=(models.Model,),
'Meta': {'object_name': 'Group'}, ),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.CreateModel(
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), name='FutureMember',
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) fields=[
}, ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
u'auth.permission': { ('org_id', models.CharField(help_text='Unique identifier of the person, e.g. a student number.', max_length=64)),
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, ('group', models.ForeignKey(to='auth.Group')),
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), ],
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), options={
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), },
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) bases=(models.Model,),
}, ),
u'auth.user': { migrations.CreateModel(
'Meta': {'object_name': 'User'}, name='GroupProfile',
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), fields=[
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), ('org_id', models.CharField(help_text='Unique identifier of the group at the organization.', max_length=64, unique=True, null=True, blank=True)),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), ('description', models.TextField(blank=True)),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('group', models.OneToOneField(to='auth.Group')),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), ],
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), options={
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'abstract': False,
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), },
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), bases=(models.Model,),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), ),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), migrations.CreateModel(
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) name='Notification',
}, fields=[
u'contenttypes.contenttype': { ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('status', model_utils.fields.StatusField(default=b'new', max_length=100, no_check_for_status=True, choices=[(b'new', 'new'), (b'delivered', 'delivered'), (b'read', 'read')])),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), ('subject_data', jsonfield.fields.JSONField(null=True)),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) ('message_data', jsonfield.fields.JSONField(null=True)),
}, ('valid_until', models.DateTimeField(default=None, null=True)),
u'dashboard.favourite': { ('to', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
'Meta': {'object_name': 'Favourite'}, ],
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), options={
'instance': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Instance']"}), 'ordering': ['-created'],
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}) },
}, bases=(models.Model,),
u'firewall.domain': { ),
'Meta': {'object_name': 'Domain'}, migrations.CreateModel(
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), name='Profile',
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), fields=[
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), ('preferred_language', models.CharField(default=b'en', max_length=32, verbose_name='preferred language', choices=[(b'en', 'English'), (b'hu', 'Hungarian')])),
'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), ('org_id', models.CharField(help_text='Unique identifier of the person, e.g. a student number.', max_length=64, unique=True, null=True, blank=True)),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), ('instance_limit', models.IntegerField(default=5)),
'ttl': ('django.db.models.fields.IntegerField', [], {'default': '600'}) ('use_gravatar', models.BooleanField(default=True, help_text='Whether to use email address as Gravatar profile image', verbose_name='Use Gravatar')),
}, ('email_notifications', models.BooleanField(default=True, help_text='Whether user wants to get digested email notifications.', verbose_name='Email notifications')),
u'firewall.group': { ('smb_password', models.CharField(default=dashboard.models.pwgen, help_text='Generated password for accessing store from virtual machines.', max_length=20, verbose_name='Samba password')),
'Meta': {'object_name': 'Group'}, ('disk_quota', sizefield.models.FileSizeField(default=2147483648, help_text='Disk quota in mebibytes.', verbose_name='disk quota')),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ],
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), options={
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'permissions': (('use_autocomplete', 'Can use autocomplete.'),),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), },
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) bases=(models.Model,),
}, ),
u'firewall.host': { migrations.AlterUniqueTogether(
'Meta': {'object_name': 'Host'}, name='futuremember',
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}), unique_together=set([('org_id', 'group')]),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), ),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ]
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('firewall.fields.IPAddressField', [], {'unique': 'True', 'max_length': '100'}),
'ipv6': ('firewall.fields.IPAddressField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'pub_ipv4': ('firewall.fields.IPAddressField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Vlan']"})
},
u'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Domain']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'network4': ('firewall.fields.IPNetworkField', [], {'max_length': '100'}),
'network6': ('firewall.fields.IPNetworkField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'network_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'reverse_domain': ('django.db.models.fields.TextField', [], {'default': "'%(d)d.%(c)d.%(b)d.%(a)d.in-addr.arpa'"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
},
u'storage.datastore': {
'Meta': {'ordering': "['name']", 'object_name': 'DataStore'},
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'storage.disk': {
'Meta': {'ordering': "['name']", 'object_name': 'Disk'},
'base': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'derivatives'", 'null': 'True', 'to': u"orm['storage.Disk']"}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'datastore': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['storage.DataStore']"}),
'destroyed': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'dev_num': ('django.db.models.fields.CharField', [], {'default': "'a'", 'max_length': '1'}),
'filename': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'size': ('sizefield.models.FileSizeField', [], {}),
'type': ('django.db.models.fields.CharField', [], {'max_length': '10'})
},
u'taggit.tag': {
'Meta': {'object_name': 'Tag'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'})
},
u'taggit.taggeditem': {
'Meta': {'object_name': 'TaggedItem'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'taggit_taggeditem_tagged_items'", 'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'taggit_taggeditem_items'", 'to': u"orm['taggit.Tag']"})
},
u'vm.instance': {
'Meta': {'ordering': "[u'pk']", 'object_name': 'Instance'},
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'active_since': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'destroyed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "u'instance_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Lease']"}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'node': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'instance_set'", 'null': 'True', 'to': u"orm['vm.Node']"}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'pw': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'req_traits': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['vm.Trait']", 'symmetrical': 'False', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "u'NOSTATE'", 'max_length': '20'}),
'template': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'instance_set'", 'null': 'True', 'to': u"orm['vm.InstanceTemplate']"}),
'time_of_delete': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'time_of_suspend': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'vnc_port': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'unique': 'True', 'null': 'True', 'blank': 'True'})
},
u'vm.instancetemplate': {
'Meta': {'ordering': "[u'name']", 'object_name': 'InstanceTemplate'},
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "u'template_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Lease']"}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.InstanceTemplate']", 'null': 'True', 'blank': 'True'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'req_traits': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['vm.Trait']", 'symmetrical': 'False', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "u'NEW'", 'max_length': '10'}),
'system': ('django.db.models.fields.TextField', [], {'blank': 'True'})
},
u'vm.lease': {
'Meta': {'ordering': "[u'name']", 'object_name': 'Lease'},
'delete_interval_seconds': ('django.db.models.fields.IntegerField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'suspend_interval_seconds': ('django.db.models.fields.IntegerField', [], {})
},
u'vm.node': {
'Meta': {'object_name': 'Node'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Host']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'overcommit': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'traits': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['vm.Trait']", 'symmetrical': 'False', 'blank': 'True'})
},
u'vm.trait': {
'Meta': {'object_name': 'Trait'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['dashboard']
\ No newline at end of file
...@@ -54,7 +54,9 @@ from .validators import connect_command_template_validator ...@@ -54,7 +54,9 @@ from .validators import connect_command_template_validator
logger = getLogger(__name__) logger = getLogger(__name__)
pwgen = User.objects.make_random_password
def pwgen():
return User.objects.make_random_password()
class Favourite(Model): class Favourite(Model):
......
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Favourite'
db.create_table(u'dashboard_favourite', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('instance', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['vm.Instance'])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal(u'dashboard', ['Favourite'])
def backwards(self, orm):
# Deleting model 'Favourite'
db.delete_table(u'dashboard_favourite')
models = {
u'acl.level': {
'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Level'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
},
u'acl.objectlevel': {
'Meta': {'unique_together': "(('content_type', 'object_id', 'level'),)", 'object_name': 'ObjectLevel'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'level': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Level']"}),
'object_id': ('django.db.models.fields.IntegerField', [], {}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'})
},
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'dashboard.favourite': {
'Meta': {'object_name': 'Favourite'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instance': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Instance']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
},
u'firewall.domain': {
'Meta': {'object_name': 'Domain'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'ttl': ('django.db.models.fields.IntegerField', [], {'default': '600'})
},
u'firewall.group': {
'Meta': {'object_name': 'Group'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
},
u'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('firewall.fields.IPAddressField', [], {'unique': 'True', 'max_length': '100'}),
'ipv6': ('firewall.fields.IPAddressField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'pub_ipv4': ('firewall.fields.IPAddressField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Vlan']"})
},
u'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Domain']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'network4': ('firewall.fields.IPNetworkField', [], {'max_length': '100'}),
'network6': ('firewall.fields.IPNetworkField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'network_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'reverse_domain': ('django.db.models.fields.TextField', [], {'default': "'%(d)d.%(c)d.%(b)d.%(a)d.in-addr.arpa'"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
},
u'storage.datastore': {
'Meta': {'ordering': "['name']", 'object_name': 'DataStore'},
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'storage.disk': {
'Meta': {'ordering': "['name']", 'object_name': 'Disk'},
'base': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'derivatives'", 'null': 'True', 'to': u"orm['storage.Disk']"}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'datastore': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['storage.DataStore']"}),
'destroyed': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'dev_num': ('django.db.models.fields.CharField', [], {'default': "'a'", 'max_length': '1'}),
'filename': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'size': ('sizefield.models.FileSizeField', [], {}),
'type': ('django.db.models.fields.CharField', [], {'max_length': '10'})
},
u'taggit.tag': {
'Meta': {'object_name': 'Tag'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'})
},
u'taggit.taggeditem': {
'Meta': {'object_name': 'TaggedItem'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'taggit_taggeditem_tagged_items'", 'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'taggit_taggeditem_items'", 'to': u"orm['taggit.Tag']"})
},
u'vm.instance': {
'Meta': {'ordering': "[u'pk']", 'object_name': 'Instance'},
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'active_since': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'destroyed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "u'instance_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Lease']"}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'node': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'instance_set'", 'null': 'True', 'to': u"orm['vm.Node']"}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'pw': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'req_traits': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['vm.Trait']", 'symmetrical': 'False', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "u'NOSTATE'", 'max_length': '20'}),
'template': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'instance_set'", 'null': 'True', 'to': u"orm['vm.InstanceTemplate']"}),
'time_of_delete': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'time_of_suspend': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'vnc_port': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'unique': 'True', 'null': 'True', 'blank': 'True'})
},
u'vm.instancetemplate': {
'Meta': {'ordering': "[u'name']", 'object_name': 'InstanceTemplate'},
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "u'template_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Lease']"}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.InstanceTemplate']", 'null': 'True', 'blank': 'True'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'req_traits': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['vm.Trait']", 'symmetrical': 'False', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "u'NEW'", 'max_length': '10'}),
'system': ('django.db.models.fields.TextField', [], {'blank': 'True'})
},
u'vm.lease': {
'Meta': {'ordering': "[u'name']", 'object_name': 'Lease'},
'delete_interval_seconds': ('django.db.models.fields.IntegerField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'suspend_interval_seconds': ('django.db.models.fields.IntegerField', [], {})
},
u'vm.node': {
'Meta': {'object_name': 'Node'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Host']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'overcommit': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'traits': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['vm.Trait']", 'symmetrical': 'False', 'blank': 'True'})
},
u'vm.trait': {
'Meta': {'object_name': 'Trait'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['dashboard']
\ No newline at end of file
...@@ -20,7 +20,7 @@ Do you want to perform the following operation on ...@@ -20,7 +20,7 @@ Do you want to perform the following operation on
<a class="btn btn-default" href="{{object.get_absolute_url}}" <a class="btn btn-default" href="{{object.get_absolute_url}}"
data-dismiss="modal">{% trans "Cancel" %}</a> data-dismiss="modal">{% trans "Cancel" %}</a>
<button class="btn btn-{{ opview.effect }} btn-op-form-send" type="submit" id="op-form-send"> <button class="btn btn-{{ opview.effect }} btn-op-form-send" type="submit" id="op-form-send">
{% if opview.icon %}<i class="fa fa-fw fa-{{opview.icon}}"></i> {% endif %}{{ op|capfirst }} {% if opview.icon %}<i class="fa fa-fw fa-{{opview.icon}}"></i> {% endif %}{{ op.name|capfirst }}
</button> </button>
</div> </div>
</form> </form>
...@@ -389,6 +389,7 @@ class RenewViewTest(unittest.TestCase): ...@@ -389,6 +389,7 @@ class RenewViewTest(unittest.TestCase):
inst = MagicMock(spec=Instance) inst = MagicMock(spec=Instance)
inst._meta.object_name = "Instance" inst._meta.object_name = "Instance"
inst.name = 'foo' inst.name = 'foo'
inst.lease = MagicMock(pk=99)
inst.renew = Instance._ops['renew'](inst) inst.renew = Instance._ops['renew'](inst)
inst.has_level.return_value = True inst.has_level.return_value = True
go.return_value = inst go.return_value = inst
...@@ -403,6 +404,7 @@ class RenewViewTest(unittest.TestCase): ...@@ -403,6 +404,7 @@ class RenewViewTest(unittest.TestCase):
patch('dashboard.views.util.messages') as msg: patch('dashboard.views.util.messages') as msg:
inst = MagicMock(spec=Instance) inst = MagicMock(spec=Instance)
inst._meta.object_name = "Instance" inst._meta.object_name = "Instance"
inst.lease = MagicMock(pk=99)
inst.renew = Instance._ops['renew'](inst) inst.renew = Instance._ops['renew'](inst)
inst.renew.async = MagicMock() inst.renew.async = MagicMock()
inst.has_level.return_value = True inst.has_level.return_value = True
...@@ -421,6 +423,7 @@ class RenewViewTest(unittest.TestCase): ...@@ -421,6 +423,7 @@ class RenewViewTest(unittest.TestCase):
patch('dashboard.views.util.messages') as msg: patch('dashboard.views.util.messages') as msg:
inst = MagicMock(spec=Instance) inst = MagicMock(spec=Instance)
inst._meta.object_name = "Instance" inst._meta.object_name = "Instance"
inst.lease = MagicMock(pk=99)
inst.renew = Instance._ops['renew'](inst) inst.renew = Instance._ops['renew'](inst)
inst.renew.async = MagicMock() inst.renew.async = MagicMock()
inst.has_level.return_value = True inst.has_level.return_value = True
...@@ -463,6 +466,7 @@ class RenewViewTest(unittest.TestCase): ...@@ -463,6 +466,7 @@ class RenewViewTest(unittest.TestCase):
with patch.object(view, 'get_object') as go: with patch.object(view, 'get_object') as go:
inst = MagicMock(spec=Instance, pk=11) inst = MagicMock(spec=Instance, pk=11)
inst._meta.object_name = "Instance" inst._meta.object_name = "Instance"
inst.lease = MagicMock(pk=99)
inst.renew = Instance._ops['renew'](inst) inst.renew = Instance._ops['renew'](inst)
inst.renew.async = MagicMock() inst.renew.async = MagicMock()
inst.has_level.return_value = False inst.has_level.return_value = False
......
...@@ -62,7 +62,7 @@ class GraphViewBase(LoginRequiredMixin, View): ...@@ -62,7 +62,7 @@ class GraphViewBase(LoginRequiredMixin, View):
metric = self.create_class(metric)(instance) metric = self.create_class(metric)(instance)
return HttpResponse(metric.get_graph(graphite_url, time), return HttpResponse(metric.get_graph(graphite_url, time),
mimetype="image/png") content_type="image/png")
def get_object(self, request, pk): def get_object(self, request, pk):
instance = self.model.objects.get(id=pk) instance = self.model.objects.get(id=pk)
......
...@@ -267,6 +267,9 @@ class UserCreationView(LoginRequiredMixin, PermissionRequiredMixin, ...@@ -267,6 +267,9 @@ class UserCreationView(LoginRequiredMixin, PermissionRequiredMixin,
template_name = 'dashboard/user-create.html' template_name = 'dashboard/user-create.html'
permission_required = "auth.add_user" permission_required = "auth.add_user"
def get_success_url(self):
reverse('dashboard.views.group-detail', args=[self.group.pk])
def get_group(self, group_pk): def get_group(self, group_pk):
self.group = get_object_or_404(Group, pk=group_pk) self.group = get_object_or_404(Group, pk=group_pk)
if not self.group.profile.has_level(self.request.user, 'owner'): if not self.group.profile.has_level(self.request.user, 'owner'):
......
...@@ -1151,7 +1151,7 @@ def get_vm_screenshot(request, pk): ...@@ -1151,7 +1151,7 @@ def get_vm_screenshot(request, pk):
# TODO handle this better # TODO handle this better
raise Http404() raise Http404()
return HttpResponse(image, mimetype="image/png") return HttpResponse(image, content_type="image/png")
class InstanceActivityDetail(CheckedDetailView): class InstanceActivityDetail(CheckedDetailView):
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime from __future__ import unicode_literals
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.db import models, migrations
import firewall.fields
from django.conf import settings
import common.models
import django.core.validators
class Migration(SchemaMigration):
def forwards(self, orm): class Migration(migrations.Migration):
# Adding model 'Rule'
db.create_table('firewall_rule', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('direction', self.gf('django.db.models.fields.BooleanField')(default=False)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Vlan'])),
('extra', self.gf('django.db.models.fields.TextField')(blank=True)),
('action', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('firewall', ['Rule'])
# Adding model 'Vlan' dependencies = [
db.create_table('firewall_vlan', ( migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ]
('vid', self.gf('django.db.models.fields.IntegerField')(unique=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('prefix4', self.gf('django.db.models.fields.IntegerField')(default=16)),
('prefix6', self.gf('django.db.models.fields.IntegerField')(default=80)),
('interface', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('net4', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('net6', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('ipv4', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('ipv6', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('comment', self.gf('django.db.models.fields.TextField')(blank=True)),
('domain', self.gf('django.db.models.fields.TextField')(blank=True)),
('dhcp_pool', self.gf('django.db.models.fields.TextField')(blank=True)),
))
db.send_create_signal('firewall', ['Vlan'])
# Adding M2M table for field en_dst on 'Vlan' operations = [
db.create_table('firewall_vlan_en_dst', ( migrations.CreateModel(
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), name='BlacklistItem',
('from_vlan', models.ForeignKey(orm['firewall.vlan'], null=False)), fields=[
('to_vlan', models.ForeignKey(orm['firewall.vlan'], null=False)) ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
)) ('ipv4', models.GenericIPAddressField(unique=True, protocol=b'ipv4')),
db.create_unique('firewall_vlan_en_dst', ['from_vlan_id', 'to_vlan_id']) ('reason', models.TextField(verbose_name='reason', blank=True)),
('snort_message', models.TextField(verbose_name='short message', blank=True)),
# Adding model 'Group' ('type', models.CharField(default=b'tempban', max_length=10, verbose_name='type', choices=[(b'permban', b'permanent ban'), (b'tempban', b'temporary ban'), (b'whitelist', b'whitelist'), (b'tempwhite', b'tempwhite')])),
db.create_table('firewall_group', ( ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created_at')),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified_at')),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)), ],
)) options={
db.send_create_signal('firewall', ['Group']) 'verbose_name': 'blacklist item',
'verbose_name_plural': 'blacklist',
# Adding M2M table for field rules on 'Group'
db.create_table('firewall_group_rules', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('group', models.ForeignKey(orm['firewall.group'], null=False)),
('rule', models.ForeignKey(orm['firewall.rule'], null=False))
))
db.create_unique('firewall_group_rules', ['group_id', 'rule_id'])
# Adding model 'Host'
db.create_table('firewall_host', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('hostname', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('mac', self.gf('firewall.models.MACAddressField')(unique=True, max_length=17)),
('ipv4', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('pub_ipv4', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39, unique=True, null=True, blank=True)),
('ipv6', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('comment', self.gf('django.db.models.fields.TextField')(blank=True)),
('location', self.gf('django.db.models.fields.TextField')(blank=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Vlan'])),
('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal('firewall', ['Host'])
# Adding M2M table for field groups on 'Host'
db.create_table('firewall_host_groups', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('host', models.ForeignKey(orm['firewall.host'], null=False)),
('group', models.ForeignKey(orm['firewall.group'], null=False))
))
db.create_unique('firewall_host_groups', ['host_id', 'group_id'])
# Adding M2M table for field rules on 'Host'
db.create_table('firewall_host_rules', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('host', models.ForeignKey(orm['firewall.host'], null=False)),
('rule', models.ForeignKey(orm['firewall.rule'], null=False))
))
db.create_unique('firewall_host_rules', ['host_id', 'rule_id'])
# Adding model 'Firewall'
db.create_table('firewall_firewall', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
))
db.send_create_signal('firewall', ['Firewall'])
# Adding M2M table for field rules on 'Firewall'
db.create_table('firewall_firewall_rules', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('firewall', models.ForeignKey(orm['firewall.firewall'], null=False)),
('rule', models.ForeignKey(orm['firewall.rule'], null=False))
))
db.create_unique('firewall_firewall_rules', ['firewall_id', 'rule_id'])
def backwards(self, orm):
# Deleting model 'Rule'
db.delete_table('firewall_rule')
# Deleting model 'Vlan'
db.delete_table('firewall_vlan')
# Removing M2M table for field en_dst on 'Vlan'
db.delete_table('firewall_vlan_en_dst')
# Deleting model 'Group'
db.delete_table('firewall_group')
# Removing M2M table for field rules on 'Group'
db.delete_table('firewall_group_rules')
# Deleting model 'Host'
db.delete_table('firewall_host')
# Removing M2M table for field groups on 'Host'
db.delete_table('firewall_host_groups')
# Removing M2M table for field rules on 'Host'
db.delete_table('firewall_host_rules')
# Deleting model 'Firewall'
db.delete_table('firewall_firewall')
# Removing M2M table for field rules on 'Firewall'
db.delete_table('firewall_firewall_rules')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
}, },
'auth.permission': { bases=(models.Model,),
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, ),
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), migrations.CreateModel(
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), name='Domain',
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), fields=[
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=40, verbose_name='name', validators=[firewall.fields.val_domain])),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created_at')),
('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified_at')),
('ttl', models.IntegerField(default=600, verbose_name='ttl')),
('description', models.TextField(verbose_name='description', blank=True)),
('owner', models.ForeignKey(verbose_name='owner', to=settings.AUTH_USER_MODEL)),
],
options={
}, },
'auth.user': { bases=(models.Model,),
'Meta': {'object_name': 'User'}, ),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), migrations.CreateModel(
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), name='EthernetDevice',
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), fields=[
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('name', models.CharField(help_text='The name of network interface the gateway should serve this network on. For example eth2.', unique=True, max_length=20, verbose_name='interface')),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created_at')),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified_at')),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ],
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), options={
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
}, },
'contenttypes.contenttype': { bases=(models.Model,),
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, ),
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), migrations.CreateModel(
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), name='Firewall',
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), fields=[
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(unique=True, max_length=20, verbose_name='name')),
],
options={
}, },
'firewall.firewall': { bases=(models.Model,),
'Meta': {'object_name': 'Firewall'}, ),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.CreateModel(
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), name='Group',
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}) fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(help_text='The name of the group.', unique=True, max_length=20, verbose_name='name')),
('description', models.TextField(help_text='Description of the group.', verbose_name='description', blank=True)),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified at')),
('owner', models.ForeignKey(verbose_name='owner', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
],
options={
}, },
'firewall.group': { bases=(models.Model,),
'Meta': {'object_name': 'Group'}, ),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.CreateModel(
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), name='Host',
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}) fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('hostname', models.CharField(help_text='The alphanumeric hostname of the host, the first part of the FQDN.', max_length=40, verbose_name='hostname', validators=[firewall.fields.val_alfanum])),
('normalized_hostname', common.models.HumanSortField(default=b'', max_length=80, monitor=b'hostname', blank=True)),
('reverse', models.CharField(validators=[firewall.fields.val_domain], max_length=40, blank=True, help_text='The fully qualified reverse hostname of the host, if different than hostname.domain.', null=True, verbose_name='reverse')),
('mac', firewall.fields.MACAddressField(help_text='The MAC (Ethernet) address of the network interface. For example: 99:AA:BB:CC:DD:EE.', unique=True, max_length=17, verbose_name='MAC address')),
('ipv4', firewall.fields.IPAddressField(help_text='The real IPv4 address of the host, for example 10.5.1.34.', unique=True, max_length=100, verbose_name='IPv4 address')),
('external_ipv4', firewall.fields.IPAddressField(help_text='The public IPv4 address of the host on the wide area network, if different.', max_length=100, null=True, verbose_name='WAN IPv4 address', blank=True)),
('ipv6', firewall.fields.IPAddressField(null=True, max_length=100, blank=True, help_text='The global IPv6 address of the host, for example 2001:db:88:200::10.', unique=True, verbose_name='IPv6 address')),
('shared_ip', models.BooleanField(default=False, help_text='If the given WAN IPv4 address is used by multiple hosts.', verbose_name='shared IP')),
('description', models.TextField(help_text='What is this host for, what kind of machine is it.', verbose_name='description', blank=True)),
('comment', models.TextField(verbose_name='Notes', blank=True)),
('location', models.TextField(help_text='The physical location of the machine.', verbose_name='location', blank=True)),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified at')),
('groups', models.ManyToManyField(help_text='Host groups the machine is part of.', to='firewall.Group', null=True, verbose_name='groups', blank=True)),
('owner', models.ForeignKey(verbose_name='owner', to=settings.AUTH_USER_MODEL, help_text='The person responsible for this host.')),
],
options={
'ordering': ('normalized_hostname', 'vlan'),
}, },
'firewall.host': { bases=(models.Model,),
'Meta': {'object_name': 'Host'}, ),
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}), migrations.CreateModel(
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), name='Record',
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}), fields=[
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('name', models.CharField(blank=True, max_length=40, null=True, verbose_name='name', validators=[firewall.fields.val_domain_wildcard])),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), ('type', models.CharField(max_length=6, verbose_name='type', choices=[(b'A', b'A'), (b'CNAME', b'CNAME'), (b'AAAA', b'AAAA'), (b'MX', b'MX'), (b'NS', b'NS'), (b'PTR', b'PTR'), (b'TXT', b'TXT')])),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), ('address', models.CharField(max_length=400, verbose_name='address')),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ('ttl', models.IntegerField(default=600, verbose_name='ttl')),
'mac': ('firewall.models.MACAddressField', [], {'unique': 'True', 'max_length': '17'}), ('description', models.TextField(verbose_name='description', blank=True)),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created_at')),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}), ('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified_at')),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}), ('domain', models.ForeignKey(verbose_name='domain', to='firewall.Domain')),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"}) ('host', models.ForeignKey(verbose_name='host', blank=True, to='firewall.Host', null=True)),
('owner', models.ForeignKey(verbose_name='owner', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ('domain', 'name'),
}, },
'firewall.rule': { bases=(models.Model,),
'Meta': {'object_name': 'Rule'}, ),
'action': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), migrations.CreateModel(
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), name='Rule',
'direction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), fields=[
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('direction', models.CharField(help_text='If the rule matches egress or ingress packets.', max_length=3, verbose_name='direction', choices=[(b'out', 'out'), (b'in', 'in')])),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"}) ('description', models.TextField(help_text='Why is the rule needed, or how does it work.', verbose_name='description', blank=True)),
('dport', models.IntegerField(blank=True, help_text='Destination port number of packets that match.', null=True, verbose_name='dest. port', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65535)])),
('sport', models.IntegerField(blank=True, help_text='Source port number of packets that match.', null=True, verbose_name='source port', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65535)])),
('weight', models.IntegerField(default=30000, help_text='Rule weight', verbose_name='weight', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65535)])),
('proto', models.CharField(choices=[(b'tcp', b'tcp'), (b'udp', b'udp'), (b'icmp', b'icmp')], max_length=10, blank=True, help_text='Protocol of packets that match.', null=True, verbose_name='protocol')),
('extra', models.TextField(help_text='Additional arguments passed literally to the iptables-rule.', verbose_name='extra arguments', blank=True)),
('action', models.CharField(default=b'drop', help_text='Accept, drop or ignore the matching packets.', max_length=10, verbose_name='action', choices=[(b'accept', 'accept'), (b'drop', 'drop'), (b'ignore', 'ignore')])),
('nat', models.BooleanField(default=False, help_text='If network address translation should be done.', verbose_name='NAT')),
('nat_external_port', models.IntegerField(blank=True, help_text='Rewrite destination port number to this if NAT is needed.', null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65535)])),
('nat_external_ipv4', firewall.fields.IPAddressField(max_length=100, null=True, verbose_name='external IPv4 address', blank=True)),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified at')),
('firewall', models.ForeignKey(related_name='rules', blank=True, to='firewall.Firewall', help_text='Firewall the rule applies to (if type is firewall).', null=True, verbose_name='firewall')),
],
options={
'ordering': ('direction', 'proto', 'sport', 'dport', 'nat_external_port', 'host'),
'verbose_name': 'rule',
'verbose_name_plural': 'rules',
}, },
'firewall.vlan': { bases=(models.Model,),
'Meta': {'object_name': 'Vlan'}, ),
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}), migrations.CreateModel(
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), name='SwitchPort',
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}), fields=[
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'en_dst': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}), ('description', models.TextField(verbose_name='description', blank=True)),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created_at')),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), ('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified_at')),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), ],
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), options={
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), },
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), bases=(models.Model,),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), ),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}), migrations.CreateModel(
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}), name='Vlan',
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}) fields=[
} ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
} ('vid', models.IntegerField(help_text='The vlan ID of the subnet.', unique=True, verbose_name='VID', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4095)])),
('name', models.CharField(help_text='The short name of the subnet.', unique=True, max_length=20, verbose_name='Name', validators=[firewall.fields.val_alfanum])),
complete_apps = ['firewall'] ('network4', firewall.fields.IPNetworkField(help_text='The IPv4 address and the prefix length of the gateway. Recommended value is the last valid address of the subnet, for example 10.4.255.254/16 for 10.4.0.0/16.', max_length=100, verbose_name='IPv4 address/prefix')),
\ No newline at end of file ('host_ipv6_prefixlen', models.IntegerField(default=112, help_text='The prefix length of the subnet assigned to a host. For example /112 = 65536 addresses/host.', verbose_name='IPv6 prefixlen/host', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(128)])),
('network6', firewall.fields.IPNetworkField(help_text='The IPv6 address and the prefix length of the gateway.', max_length=100, null=True, verbose_name='IPv6 address/prefix', blank=True)),
('snat_ip', models.GenericIPAddressField(protocol=b'ipv4', blank=True, help_text='Common IPv4 address used for address translation of connections to the networks selected below (typically to the internet).', null=True, verbose_name='NAT IP address')),
('network_type', models.CharField(default=b'portforward', max_length=20, verbose_name='network type', choices=[(b'public', 'public'), (b'portforward', 'portforward')])),
('managed', models.BooleanField(default=True, verbose_name='managed')),
('description', models.TextField(help_text='Description of the goals and elements of the vlan network.', verbose_name='description', blank=True)),
('comment', models.TextField(help_text='Notes, comments about the network', verbose_name='comment', blank=True)),
('reverse_domain', models.TextField(default=b'%(d)d.%(c)d.%(b)d.%(a)d.in-addr.arpa', help_text='Template of the IPv4 reverse domain name that should be generated for each host. The template should contain four tokens: "%(a)d", "%(b)d", "%(c)d", and "%(d)d", representing the four bytes of the address, respectively, in decimal notation. For example, the template for the standard reverse address is: "%(d)d.%(c)d.%(b)d.%(a)d.in-addr.arpa".', verbose_name='reverse domain', validators=[firewall.fields.val_reverse_domain])),
('ipv6_template', models.TextField(default=b'2001:738:2001:4031:%(b)d:%(c)d:%(d)d:0', verbose_name='ipv6 template', validators=[firewall.fields.val_ipv6_template])),
('dhcp_pool', models.TextField(help_text='The address range of the DHCP pool: empty for no DHCP service, "manual" for no DHCP pool, or the first and last address of the range separated by a space.', verbose_name='DHCP pool', blank=True)),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified at')),
('domain', models.ForeignKey(verbose_name='domain name', to='firewall.Domain', help_text='Domain name of the members of this network.')),
('owner', models.ForeignKey(verbose_name='owner', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
('snat_to', models.ManyToManyField(help_text='Connections to these networks should be network address translated, i.e. their source address is rewritten to the value of NAT IP address.', to='firewall.Vlan', null=True, verbose_name='NAT to', blank=True)),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='VlanGroup',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(help_text='The name of the group.', unique=True, max_length=20, verbose_name='name')),
('description', models.TextField(help_text='Description of the group.', verbose_name='description', blank=True)),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
('modified_at', models.DateTimeField(auto_now=True, verbose_name='modified at')),
('owner', models.ForeignKey(verbose_name='owner', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
('vlans', models.ManyToManyField(help_text='The vlans which are members of the group.', to='firewall.Vlan', null=True, verbose_name='vlans', blank=True)),
],
options={
},
bases=(models.Model,),
),
migrations.AddField(
model_name='switchport',
name='tagged_vlans',
field=models.ForeignKey(related_name='tagged_ports', verbose_name='tagged vlans', blank=True, to='firewall.VlanGroup', null=True),
preserve_default=True,
),
migrations.AddField(
model_name='switchport',
name='untagged_vlan',
field=models.ForeignKey(related_name='untagged_ports', verbose_name='untagged vlan', to='firewall.Vlan'),
preserve_default=True,
),
migrations.AddField(
model_name='rule',
name='foreign_network',
field=models.ForeignKey(related_name='ForeignRules', verbose_name='foreign network', to='firewall.VlanGroup', help_text='The group of vlans the matching packet goes to (direction out) or from (in).'),
preserve_default=True,
),
migrations.AddField(
model_name='rule',
name='host',
field=models.ForeignKey(related_name='rules', blank=True, to='firewall.Host', help_text='Host the rule applies to (if type is host).', null=True, verbose_name='host'),
preserve_default=True,
),
migrations.AddField(
model_name='rule',
name='hostgroup',
field=models.ForeignKey(related_name='rules', blank=True, to='firewall.Group', help_text='Group of hosts the rule applies to (if type is host).', null=True, verbose_name='host group'),
preserve_default=True,
),
migrations.AddField(
model_name='rule',
name='owner',
field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text='The user responsible for this rule.', null=True, verbose_name='owner'),
preserve_default=True,
),
migrations.AddField(
model_name='rule',
name='vlan',
field=models.ForeignKey(related_name='rules', blank=True, to='firewall.Vlan', help_text='Vlan the rule applies to (if type is vlan).', null=True, verbose_name='vlan'),
preserve_default=True,
),
migrations.AddField(
model_name='rule',
name='vlangroup',
field=models.ForeignKey(related_name='rules', blank=True, to='firewall.VlanGroup', help_text='Group of vlans the rule applies to (if type is vlan).', null=True, verbose_name='vlan group'),
preserve_default=True,
),
migrations.AddField(
model_name='host',
name='vlan',
field=models.ForeignKey(verbose_name='vlan', to='firewall.Vlan', help_text='Vlan network that the host is part of.'),
preserve_default=True,
),
migrations.AlterUniqueTogether(
name='host',
unique_together=set([('hostname', 'vlan')]),
),
migrations.AddField(
model_name='ethernetdevice',
name='switch_port',
field=models.ForeignKey(related_name='ethernet_devices', verbose_name='switch port', to='firewall.SwitchPort'),
preserve_default=True,
),
migrations.AddField(
model_name='blacklistitem',
name='host',
field=models.ForeignKey(verbose_name='host', blank=True, to='firewall.Host', null=True),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import firewall.fields
class Migration(migrations.Migration):
dependencies = [
('firewall', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='vlan',
name='ipv6_template',
field=models.TextField(help_text='Template for translating IPv4 addresses to IPv6. Automatically generated hosts in dual-stack networks will get this address. The template can contain four tokens: "%(a)d", "%(b)d", "%(c)d", and "%(d)d", representing the four bytes of the IPv4 address, respectively, in decimal notation. Moreover you can use any standard printf format specification like %(a)02x to get the first byte as two hexadecimal digits. Usual choices for mapping 198.51.100.0/24 to 2001:0DB8:1:1::/64 would be "2001:db8:1:1:%(d)d::" and "2001:db8:1:1:%(d)02x00::".', blank=True, verbose_name='ipv6 template', validators=[firewall.fields.val_ipv6_template]),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Rule'
db.create_table('firewall_rule', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('direction', self.gf('django.db.models.fields.BooleanField')(default=False)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Vlan'])),
('extra', self.gf('django.db.models.fields.TextField')(blank=True)),
('action', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('firewall', ['Rule'])
# Adding model 'Vlan'
db.create_table('firewall_vlan', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('vid', self.gf('django.db.models.fields.IntegerField')(unique=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('prefix4', self.gf('django.db.models.fields.IntegerField')(default=16)),
('prefix6', self.gf('django.db.models.fields.IntegerField')(default=80)),
('interface', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('net4', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('net6', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('ipv4', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('ipv6', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('comment', self.gf('django.db.models.fields.TextField')(blank=True)),
('domain', self.gf('django.db.models.fields.TextField')(blank=True)),
('dhcp_pool', self.gf('django.db.models.fields.TextField')(blank=True)),
))
db.send_create_signal('firewall', ['Vlan'])
# Adding M2M table for field en_dst on 'Vlan'
db.create_table('firewall_vlan_en_dst', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('from_vlan', models.ForeignKey(orm['firewall.vlan'], null=False)),
('to_vlan', models.ForeignKey(orm['firewall.vlan'], null=False))
))
db.create_unique('firewall_vlan_en_dst', ['from_vlan_id', 'to_vlan_id'])
# Adding model 'Group'
db.create_table('firewall_group', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
))
db.send_create_signal('firewall', ['Group'])
# Adding M2M table for field rules on 'Group'
db.create_table('firewall_group_rules', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('group', models.ForeignKey(orm['firewall.group'], null=False)),
('rule', models.ForeignKey(orm['firewall.rule'], null=False))
))
db.create_unique('firewall_group_rules', ['group_id', 'rule_id'])
# Adding model 'Host'
db.create_table('firewall_host', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('hostname', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
('mac', self.gf('firewall.models.MACAddressField')(unique=True, max_length=17)),
('ipv4', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('pub_ipv4', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39, unique=True, null=True, blank=True)),
('ipv6', self.gf('django.db.models.fields.GenericIPAddressField')(unique=True, max_length=39)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('comment', self.gf('django.db.models.fields.TextField')(blank=True)),
('location', self.gf('django.db.models.fields.TextField')(blank=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Vlan'])),
('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal('firewall', ['Host'])
# Adding M2M table for field groups on 'Host'
db.create_table('firewall_host_groups', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('host', models.ForeignKey(orm['firewall.host'], null=False)),
('group', models.ForeignKey(orm['firewall.group'], null=False))
))
db.create_unique('firewall_host_groups', ['host_id', 'group_id'])
# Adding M2M table for field rules on 'Host'
db.create_table('firewall_host_rules', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('host', models.ForeignKey(orm['firewall.host'], null=False)),
('rule', models.ForeignKey(orm['firewall.rule'], null=False))
))
db.create_unique('firewall_host_rules', ['host_id', 'rule_id'])
# Adding model 'Firewall'
db.create_table('firewall_firewall', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
))
db.send_create_signal('firewall', ['Firewall'])
# Adding M2M table for field rules on 'Firewall'
db.create_table('firewall_firewall_rules', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('firewall', models.ForeignKey(orm['firewall.firewall'], null=False)),
('rule', models.ForeignKey(orm['firewall.rule'], null=False))
))
db.create_unique('firewall_firewall_rules', ['firewall_id', 'rule_id'])
def backwards(self, orm):
# Deleting model 'Rule'
db.delete_table('firewall_rule')
# Deleting model 'Vlan'
db.delete_table('firewall_vlan')
# Removing M2M table for field en_dst on 'Vlan'
db.delete_table('firewall_vlan_en_dst')
# Deleting model 'Group'
db.delete_table('firewall_group')
# Removing M2M table for field rules on 'Group'
db.delete_table('firewall_group_rules')
# Deleting model 'Host'
db.delete_table('firewall_host')
# Removing M2M table for field groups on 'Host'
db.delete_table('firewall_host_groups')
# Removing M2M table for field rules on 'Host'
db.delete_table('firewall_host_rules')
# Deleting model 'Firewall'
db.delete_table('firewall_firewall')
# Removing M2M table for field rules on 'Firewall'
db.delete_table('firewall_firewall_rules')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'firewall.firewall': {
'Meta': {'object_name': 'Firewall'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.models.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.rule': {
'Meta': {'object_name': 'Rule'},
'action': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'direction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'en_dst': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}),
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}
}
complete_apps = ['firewall']
\ No newline at end of file
...@@ -46,11 +46,10 @@ from itertools import chain ...@@ -46,11 +46,10 @@ from itertools import chain
from dashboard.views import AclUpdateView from dashboard.views import AclUpdateView
from dashboard.forms import AclUserOrGroupAddForm from dashboard.forms import AclUserOrGroupAddForm
from django.utils import simplejson
try: try:
from django.http import JsonResponse from django.http import JsonResponse
except ImportError: except ImportError:
from django.utils import simplejson
class JsonResponse(HttpResponse): class JsonResponse(HttpResponse):
"""JSON response for Django < 1.7 """JSON response for Django < 1.7
https://gist.github.com/philippeowagner/3179eb475fe1795d6515 https://gist.github.com/philippeowagner/3179eb475fe1795d6515
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime from __future__ import unicode_literals
from south.db import db
from south.v2 import SchemaMigration from django.db import models, migrations
from django.db import models import django.utils.timezone
import model_utils.fields
import sizefield.models
class Migration(SchemaMigration):
def forwards(self, orm): class Migration(migrations.Migration):
# Adding model 'Disk'
db.create_table('storage_disk', ( dependencies = [
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ]
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
('path', self.gf('django.db.models.fields.CharField')(unique=True, max_length=200)), operations = [
('format', self.gf('django.db.models.fields.CharField')(max_length=10)), migrations.CreateModel(
('size', self.gf('django.db.models.fields.IntegerField')()), name='DataStore',
('type', self.gf('django.db.models.fields.CharField')(max_length=10)), fields=[
('base', self.gf('django.db.models.fields.related.ForeignKey')(related_name='snapshots', to=orm['storage.Disk'])), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('original_parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storage.Disk'])), ('name', models.CharField(unique=True, max_length=100, verbose_name='name')),
)) ('path', models.CharField(unique=True, max_length=200, verbose_name='path')),
db.send_create_signal('storage', ['Disk']) ('hostname', models.CharField(unique=True, max_length=40, verbose_name='hostname')),
],
options={
def backwards(self, orm): 'ordering': ['name'],
# Deleting model 'Disk' 'verbose_name': 'datastore',
db.delete_table('storage_disk') 'verbose_name_plural': 'datastores',
},
bases=(models.Model,),
models = { ),
'storage.disk': { migrations.CreateModel(
'Meta': {'ordering': "['name']", 'object_name': 'Disk'}, name='Disk',
'base': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'snapshots'", 'to': "orm['storage.Disk']"}), fields=[
'format': ('django.db.models.fields.CharField', [], {'max_length': '10'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
'original_parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storage.Disk']"}), ('name', models.CharField(max_length=100, verbose_name='name', blank=True)),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}), ('filename', models.CharField(unique=True, max_length=256, verbose_name='filename')),
'size': ('django.db.models.fields.IntegerField', [], {}), ('type', models.CharField(max_length=10, choices=[('qcow2-norm', 'qcow2 normal'), ('qcow2-snap', 'qcow2 snapshot'), ('iso', 'iso'), ('raw-ro', 'raw read-only'), ('raw-rw', 'raw')])),
'type': ('django.db.models.fields.CharField', [], {'max_length': '10'}) ('size', sizefield.models.FileSizeField(default=None, null=True)),
} ('dev_num', models.CharField(default='a', max_length=1, verbose_name='device number')),
} ('destroyed', models.DateTimeField(default=None, null=True, blank=True)),
('is_ready', models.BooleanField(default=False)),
complete_apps = ['storage'] ('base', models.ForeignKey(related_name='derivatives', blank=True, to='storage.Disk', null=True)),
\ No newline at end of file ('datastore', models.ForeignKey(verbose_name='datastore', to='storage.DataStore', help_text='The datastore that holds the disk.')),
],
options={
'ordering': ['name'],
'verbose_name': 'disk',
'verbose_name_plural': 'disks',
'permissions': (('create_empty_disk', 'Can create an empty disk.'), ('download_disk', 'Can download a disk.'), ('resize_disk', 'Can resize a disk.')),
},
bases=(models.Model,),
),
]
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Disk'
db.create_table('storage_disk', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
('path', self.gf('django.db.models.fields.CharField')(unique=True, max_length=200)),
('format', self.gf('django.db.models.fields.CharField')(max_length=10)),
('size', self.gf('django.db.models.fields.IntegerField')()),
('type', self.gf('django.db.models.fields.CharField')(max_length=10)),
('base', self.gf('django.db.models.fields.related.ForeignKey')(related_name='snapshots', to=orm['storage.Disk'])),
('original_parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storage.Disk'])),
))
db.send_create_signal('storage', ['Disk'])
def backwards(self, orm):
# Deleting model 'Disk'
db.delete_table('storage_disk')
models = {
'storage.disk': {
'Meta': {'ordering': "['name']", 'object_name': 'Disk'},
'base': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'snapshots'", 'to': "orm['storage.Disk']"}),
'format': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'original_parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storage.Disk']"}),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
'size': ('django.db.models.fields.IntegerField', [], {}),
'type': ('django.db.models.fields.CharField', [], {'max_length': '10'})
}
}
complete_apps = ['storage']
\ No newline at end of file
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime from __future__ import unicode_literals
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.db import models, migrations
import taggit.managers
import model_utils.fields
import jsonfield.fields
import common.operations
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
import common.models
import django.core.validators
class Migration(SchemaMigration):
def forwards(self, orm): class Migration(migrations.Migration):
# Adding model 'NamedBaseResourceConfig'
db.create_table(u'vm_namedbaseresourceconfig', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('max_ram_size', self.gf('django.db.models.fields.IntegerField')()),
('arch', self.gf('django.db.models.fields.CharField')(max_length=10)),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('boot_menu', self.gf('django.db.models.fields.BooleanField')(default=False)),
('raw_data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
))
db.send_create_signal(u'vm', ['NamedBaseResourceConfig'])
# Adding model 'Node' dependencies = [
db.create_table(u'vm_node', ( ('taggit', '0001_initial'),
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('storage', '0001_initial'),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), ('firewall', '0001_initial'),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)), ]
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Host'])),
('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal(u'vm', ['Node'])
# Adding model 'NodeActivity' operations = [
db.create_table(u'vm_nodeactivity', ( migrations.CreateModel(
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), name='Instance',
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), fields=[
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('activity_code', self.gf('django.db.models.fields.CharField')(max_length=100)), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
('task_uuid', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True, null=True, blank=True)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('node', self.gf('django.db.models.fields.related.ForeignKey')(related_name='activity_log', to=orm['vm.Node'])), ('status', model_utils.fields.StatusField(default='NOSTATE', max_length=100, verbose_name='status', no_check_for_status=True, choices=[('NOSTATE', 'no state'), ('RUNNING', 'running'), ('STOPPED', 'stopped'), ('SUSPENDED', 'suspended'), ('ERROR', 'error'), ('PENDING', 'pending'), ('DESTROYED', 'destroyed')])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)), ('status_changed', model_utils.fields.MonitorField(default=django.utils.timezone.now, verbose_name='status changed', monitor='status')),
('started', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('num_cores', models.IntegerField(help_text='Number of virtual CPU cores available to the virtual machine.', verbose_name='number of cores', validators=[django.core.validators.MinValueValidator(0)])),
('finished', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('ram_size', models.IntegerField(help_text='Mebibytes of memory.', verbose_name='RAM size', validators=[django.core.validators.MinValueValidator(0)])),
('result', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), ('max_ram_size', models.IntegerField(help_text='Upper memory size limit for balloning.', verbose_name='maximal RAM size', validators=[django.core.validators.MinValueValidator(0)])),
('status', self.gf('django.db.models.fields.CharField')(default='PENDING', max_length=50)), ('arch', models.CharField(max_length=10, verbose_name='architecture', choices=[('x86_64', 'x86-64 (64 bit)'), ('i686', 'x86 (32 bit)')])),
)) ('priority', models.IntegerField(help_text='CPU priority.', verbose_name='priority', validators=[django.core.validators.MinValueValidator(0)])),
db.send_create_signal(u'vm', ['NodeActivity']) ('access_method', models.CharField(help_text='Primary remote access method.', max_length=10, verbose_name='access method', choices=[('nx', 'NX'), ('rdp', 'RDP'), ('ssh', 'SSH')])),
('boot_menu', models.BooleanField(default=False, help_text='Show boot device selection menu on boot.', verbose_name='boot menu')),
# Adding model 'Lease' ('raw_data', models.TextField(help_text='Additional libvirt domain parameters in XML format.', verbose_name='raw_data', blank=True)),
db.create_table(u'vm_lease', ( ('system', models.TextField(help_text='Name of operating system in format like "Ubuntu 12.04 LTS Desktop amd64".', verbose_name='operating system')),
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('has_agent', models.BooleanField(default=True, help_text='If the machine has agent installed, and the manager should wait for its start.', verbose_name='has agent')),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)), ('name', models.CharField(help_text='Human readable name of instance.', max_length=100, verbose_name='name', blank=True)),
('suspend_interval_seconds', self.gf('django.db.models.fields.IntegerField')()), ('description', models.TextField(verbose_name='description', blank=True)),
('delete_interval_seconds', self.gf('django.db.models.fields.IntegerField')()), ('pw', models.CharField(help_text='Original password of the instance.', max_length=20, verbose_name='password')),
)) ('time_of_suspend', models.DateTimeField(default=None, help_text='Proposed time of automatic suspension.', null=True, verbose_name='time of suspend', blank=True)),
db.send_create_signal(u'vm', ['Lease']) ('time_of_delete', models.DateTimeField(default=None, help_text='Proposed time of automatic deletion.', null=True, verbose_name='time of delete', blank=True)),
('vnc_port', models.IntegerField(null=True, default=None, blank=True, help_text='TCP port where VNC console listens.', unique=True, verbose_name='vnc_port')),
# Adding model 'InstanceTemplate' ('is_base', models.BooleanField(default=False)),
db.create_table(u'vm_instancetemplate', ( ('destroyed_at', models.DateTimeField(help_text="The virtual machine's time of destruction.", null=True, blank=True)),
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('disks', models.ManyToManyField(help_text='Set of mounted disks.', related_name='instance_set', verbose_name='disks', to='storage.Disk')),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), ],
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), options={
('num_cores', self.gf('django.db.models.fields.IntegerField')()), 'ordering': ('pk',),
('ram_size', self.gf('django.db.models.fields.IntegerField')()), 'db_table': 'vm_instance',
('max_ram_size', self.gf('django.db.models.fields.IntegerField')()), 'verbose_name': 'instance',
('arch', self.gf('django.db.models.fields.CharField')(max_length=10)), 'verbose_name_plural': 'instances',
('priority', self.gf('django.db.models.fields.IntegerField')()), 'permissions': (('access_console', 'Can access the graphical console of a VM.'), ('change_resources', 'Can change resources of a running VM.'), ('set_resources', 'Can change resources of a new VM.'), ('create_vm', 'Can create a new VM.'), ('redeploy', 'Can redeploy a VM.'), ('config_ports', 'Can configure port forwards.'), ('recover', 'Can recover a destroyed VM.'), ('emergency_change_state', 'Can change VM state to NOSTATE.')),
('boot_menu', self.gf('django.db.models.fields.BooleanField')(default=False)),
('raw_data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['vm.InstanceTemplate'], null=True, blank=True)),
('system', self.gf('django.db.models.fields.TextField')(blank=True)),
('access_method', self.gf('django.db.models.fields.CharField')(max_length=10)),
('state', self.gf('django.db.models.fields.CharField')(default='NEW', max_length=10)),
('lease', self.gf('django.db.models.fields.related.ForeignKey')(related_name='template_set', to=orm['vm.Lease'])),
))
db.send_create_signal(u'vm', ['InstanceTemplate'])
# Adding M2M table for field disks on 'InstanceTemplate'
m2m_table_name = db.shorten_name(u'vm_instancetemplate_disks')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('instancetemplate', models.ForeignKey(orm[u'vm.instancetemplate'], null=False)),
('disk', models.ForeignKey(orm[u'storage.disk'], null=False))
))
db.create_unique(m2m_table_name, ['instancetemplate_id', 'disk_id'])
# Adding model 'InterfaceTemplate'
db.create_table(u'vm_interfacetemplate', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Vlan'])),
('managed', self.gf('django.db.models.fields.BooleanField')(default=True)),
('template', self.gf('django.db.models.fields.related.ForeignKey')(related_name='interface_set', to=orm['vm.InstanceTemplate'])),
))
db.send_create_signal(u'vm', ['InterfaceTemplate'])
# Adding model 'Instance'
db.create_table(u'vm_instance', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('max_ram_size', self.gf('django.db.models.fields.IntegerField')()),
('arch', self.gf('django.db.models.fields.CharField')(max_length=10)),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('boot_menu', self.gf('django.db.models.fields.BooleanField')(default=False)),
('raw_data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('template', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='instance_set', null=True, to=orm['vm.InstanceTemplate'])),
('pw', self.gf('django.db.models.fields.CharField')(max_length=20)),
('time_of_suspend', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)),
('time_of_delete', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)),
('active_since', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('node', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='instance_set', null=True, to=orm['vm.Node'])),
('state', self.gf('django.db.models.fields.CharField')(default='NOSTATE', max_length=20)),
('lease', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['vm.Lease'])),
('access_method', self.gf('django.db.models.fields.CharField')(max_length=10)),
('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal(u'vm', ['Instance'])
# Adding M2M table for field disks on 'Instance'
m2m_table_name = db.shorten_name(u'vm_instance_disks')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('instance', models.ForeignKey(orm[u'vm.instance'], null=False)),
('disk', models.ForeignKey(orm[u'storage.disk'], null=False))
))
db.create_unique(m2m_table_name, ['instance_id', 'disk_id'])
# Adding model 'InstanceActivity'
db.create_table(u'vm_instanceactivity', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('activity_code', self.gf('django.db.models.fields.CharField')(max_length=100)),
('task_uuid', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True, null=True, blank=True)),
('instance', self.gf('django.db.models.fields.related.ForeignKey')(related_name='activity_log', to=orm['vm.Instance'])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
('started', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('finished', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('result', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('state', self.gf('django.db.models.fields.CharField')(default='PENDING', max_length=50)),
))
db.send_create_signal(u'vm', ['InstanceActivity'])
# Adding model 'Interface'
db.create_table(u'vm_interface', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(related_name='vm_interface', to=orm['firewall.Vlan'])),
('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Host'], null=True, blank=True)),
('instance', self.gf('django.db.models.fields.related.ForeignKey')(related_name='interface_set', to=orm['vm.Instance'])),
))
db.send_create_signal(u'vm', ['Interface'])
def backwards(self, orm):
# Deleting model 'NamedBaseResourceConfig'
db.delete_table(u'vm_namedbaseresourceconfig')
# Deleting model 'Node'
db.delete_table(u'vm_node')
# Deleting model 'NodeActivity'
db.delete_table(u'vm_nodeactivity')
# Deleting model 'Lease'
db.delete_table(u'vm_lease')
# Deleting model 'InstanceTemplate'
db.delete_table(u'vm_instancetemplate')
# Removing M2M table for field disks on 'InstanceTemplate'
db.delete_table(db.shorten_name(u'vm_instancetemplate_disks'))
# Deleting model 'InterfaceTemplate'
db.delete_table(u'vm_interfacetemplate')
# Deleting model 'Instance'
db.delete_table(u'vm_instance')
# Removing M2M table for field disks on 'Instance'
db.delete_table(db.shorten_name(u'vm_instance_disks'))
# Deleting model 'InstanceActivity'
db.delete_table(u'vm_instanceactivity')
# Deleting model 'Interface'
db.delete_table(u'vm_interface')
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
}, },
u'contenttypes.contenttype': { bases=(common.operations.OperatedMixin, models.Model),
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, ),
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), migrations.CreateModel(
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), name='InstanceActivity',
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), fields=[
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('activity_code', models.CharField(max_length=100, verbose_name='activity code')),
('readable_name_data', jsonfield.fields.JSONField(help_text='Human readable name of activity.', null=True, verbose_name='human readable name', blank=True)),
('task_uuid', models.CharField(null=True, max_length=50, blank=True, help_text='Celery task unique identifier.', unique=True, verbose_name='task_uuid')),
('started', models.DateTimeField(help_text='Time of activity initiation.', null=True, verbose_name='started at', blank=True)),
('finished', models.DateTimeField(help_text='Time of activity finalization.', null=True, verbose_name='finished at', blank=True)),
('succeeded', models.NullBooleanField(help_text='True, if the activity has finished successfully.')),
('result_data', jsonfield.fields.JSONField(help_text='Human readable result of activity.', null=True, verbose_name='result', blank=True)),
('resultant_state', models.CharField(max_length=20, null=True, blank=True)),
('interruptible', models.BooleanField(default=False, help_text='Other activities can interrupt this one.')),
('instance', models.ForeignKey(related_name='activity_log', verbose_name='instance', to='vm.Instance', help_text='Instance this activity works on.')),
('parent', models.ForeignKey(related_name='children', blank=True, to='vm.InstanceActivity', null=True)),
('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text='The person who started this activity.', null=True, verbose_name='user')),
],
options={
'ordering': ['-finished', '-started', 'instance', '-id'],
'db_table': 'vm_instanceactivity',
}, },
u'firewall.domain': { bases=(models.Model,),
'Meta': {'object_name': 'Domain'}, ),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), migrations.CreateModel(
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), name='InstanceTemplate',
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), fields=[
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
'ttl': ('django.db.models.fields.IntegerField', [], {'default': '600'}) ('num_cores', models.IntegerField(help_text='Number of virtual CPU cores available to the virtual machine.', verbose_name='number of cores', validators=[django.core.validators.MinValueValidator(0)])),
('ram_size', models.IntegerField(help_text='Mebibytes of memory.', verbose_name='RAM size', validators=[django.core.validators.MinValueValidator(0)])),
('max_ram_size', models.IntegerField(help_text='Upper memory size limit for balloning.', verbose_name='maximal RAM size', validators=[django.core.validators.MinValueValidator(0)])),
('arch', models.CharField(max_length=10, verbose_name='architecture', choices=[('x86_64', 'x86-64 (64 bit)'), ('i686', 'x86 (32 bit)')])),
('priority', models.IntegerField(help_text='CPU priority.', verbose_name='priority', validators=[django.core.validators.MinValueValidator(0)])),
('access_method', models.CharField(help_text='Primary remote access method.', max_length=10, verbose_name='access method', choices=[('nx', 'NX'), ('rdp', 'RDP'), ('ssh', 'SSH')])),
('boot_menu', models.BooleanField(default=False, help_text='Show boot device selection menu on boot.', verbose_name='boot menu')),
('raw_data', models.TextField(help_text='Additional libvirt domain parameters in XML format.', verbose_name='raw_data', blank=True)),
('system', models.TextField(help_text='Name of operating system in format like "Ubuntu 12.04 LTS Desktop amd64".', verbose_name='operating system')),
('has_agent', models.BooleanField(default=True, help_text='If the machine has agent installed, and the manager should wait for its start.', verbose_name='has agent')),
('name', models.CharField(help_text='Human readable name of template.', max_length=100, verbose_name='name')),
('description', models.TextField(verbose_name='description', blank=True)),
('disks', models.ManyToManyField(help_text='Disks which are to be mounted.', related_name='template_set', verbose_name='disks', to='storage.Disk')),
],
options={
'ordering': ('name',),
'db_table': 'vm_instancetemplate',
'verbose_name': 'template',
'verbose_name_plural': 'templates',
'permissions': (('create_template', 'Can create an instance template.'), ('create_base_template', 'Can create an instance template (base).'), ('change_template_resources', 'Can change resources of a template.')),
}, },
u'firewall.group': { bases=(models.Model,),
'Meta': {'object_name': 'Group'}, ),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), migrations.CreateModel(
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), name='Interface',
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), fields=[
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), ('host', models.ForeignKey(verbose_name='host', blank=True, to='firewall.Host', null=True)),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) ('instance', models.ForeignKey(related_name='interface_set', verbose_name='instance', to='vm.Instance')),
('vlan', models.ForeignKey(related_name='vm_interface', verbose_name='vlan', to='firewall.Vlan')),
],
options={
'ordering': ('-vlan__managed',),
'db_table': 'vm_interface',
}, },
u'firewall.host': { bases=(models.Model,),
'Meta': {'object_name': 'Host'}, ),
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}), migrations.CreateModel(
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), name='InterfaceTemplate',
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), fields=[
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Group']", 'null': 'True', 'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}), ('managed', models.BooleanField(default=True, help_text='If a firewall host (i.e. IP address association) should be generated.', verbose_name='managed')),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('template', models.ForeignKey(related_name='interface_set', verbose_name='template', to='vm.InstanceTemplate', help_text='Template the interface template belongs to.')),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}), ('vlan', models.ForeignKey(verbose_name='vlan', to='firewall.Vlan', help_text='Network the interface belongs to.')),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}), ],
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}), options={
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}), 'db_table': 'vm_interfacetemplate',
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'verbose_name': 'interface template',
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), 'verbose_name_plural': 'interface templates',
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}), 'permissions': (),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Vlan']"})
}, },
u'firewall.vlan': { bases=(models.Model,),
'Meta': {'object_name': 'Vlan'}, ),
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}), migrations.CreateModel(
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), name='Lease',
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), fields=[
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Domain']"}), ('name', models.CharField(unique=True, max_length=100, verbose_name='name')),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('suspend_interval_seconds', models.IntegerField(help_text='Number of seconds after the an instance is suspended.', null=True, verbose_name='suspend interval', blank=True)),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), ('delete_interval_seconds', models.IntegerField(help_text='Number of seconds after the an instance is deleted.', null=True, verbose_name='delete interval', blank=True)),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), ],
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), options={
'network4': ('firewall.fields.IPNetworkField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'ordering': ['name'],
'network6': ('firewall.fields.IPNetworkField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'db_table': 'vm_lease',
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), 'permissions': (('create_leases', 'Can create new leases.'),),
'reverse_domain': ('django.db.models.fields.TextField', [], {'default': "'%(d)d.%(c)d.%(b)d.%(a)d.in-addr.arpa'"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}, },
u'storage.datastore': { bases=(models.Model,),
'Meta': {'ordering': "['name']", 'object_name': 'DataStore'}, ),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.CreateModel(
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), name='NamedBaseResourceConfig',
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}) fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('num_cores', models.IntegerField(help_text='Number of virtual CPU cores available to the virtual machine.', verbose_name='number of cores', validators=[django.core.validators.MinValueValidator(0)])),
('ram_size', models.IntegerField(help_text='Mebibytes of memory.', verbose_name='RAM size', validators=[django.core.validators.MinValueValidator(0)])),
('max_ram_size', models.IntegerField(help_text='Upper memory size limit for balloning.', verbose_name='maximal RAM size', validators=[django.core.validators.MinValueValidator(0)])),
('arch', models.CharField(max_length=10, verbose_name='architecture', choices=[('x86_64', 'x86-64 (64 bit)'), ('i686', 'x86 (32 bit)')])),
('priority', models.IntegerField(help_text='CPU priority.', verbose_name='priority', validators=[django.core.validators.MinValueValidator(0)])),
('name', models.CharField(help_text='Name of base resource configuration.', unique=True, max_length=50, verbose_name='name')),
],
options={
'db_table': 'vm_namedbaseresourceconfig',
}, },
u'storage.disk': { bases=(models.Model,),
'Meta': {'ordering': "['name']", 'object_name': 'Disk'}, ),
'base': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'derivatives'", 'null': 'True', 'to': u"orm['storage.Disk']"}), migrations.CreateModel(
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), name='Node',
'datastore': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['storage.DataStore']"}), fields=[
'dev_num': ('django.db.models.fields.CharField', [], {'max_length': '1'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'format': ('django.db.models.fields.CharField', [], {'max_length': '10'}), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), ('name', models.CharField(help_text='Human readable name of node.', unique=True, max_length=50, verbose_name='name')),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), ('normalized_name', common.models.HumanSortField(default=b'', max_length=100, monitor='name', blank=True)),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ('priority', models.IntegerField(help_text='Node usage priority.', verbose_name='priority')),
'size': ('django.db.models.fields.IntegerField', [], {}), ('enabled', models.BooleanField(default=False, help_text='Indicates whether the node can be used for hosting.', verbose_name='enabled')),
'type': ('django.db.models.fields.CharField', [], {'max_length': '10'}) ('schedule_enabled', models.BooleanField(default=False, help_text='Indicates whether a vm can be automatically scheduled to this node.', verbose_name='schedule enabled')),
('overcommit', models.FloatField(default=1.0, help_text='The ratio of total memory with to without overcommit.', verbose_name='overcommit ratio')),
('host', models.ForeignKey(verbose_name='host', to='firewall.Host', help_text='Host in firewall.')),
('tags', taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='tags')),
],
options={
'ordering': ('-enabled', 'normalized_name'),
'db_table': 'vm_node',
'permissions': (('view_statistics', 'Can view Node box and statistics.'),),
}, },
u'vm.instance': { bases=(common.operations.OperatedMixin, models.Model),
'Meta': {'ordering': "['pk']", 'object_name': 'Instance'}, ),
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}), migrations.CreateModel(
'active_since': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), name='NodeActivity',
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}), fields=[
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'instance_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}), ('activity_code', models.CharField(max_length=100, verbose_name='activity code')),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('readable_name_data', jsonfield.fields.JSONField(help_text='Human readable name of activity.', null=True, verbose_name='human readable name', blank=True)),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Lease']"}), ('task_uuid', models.CharField(null=True, max_length=50, blank=True, help_text='Celery task unique identifier.', unique=True, verbose_name='task_uuid')),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}), ('started', models.DateTimeField(help_text='Time of activity initiation.', null=True, verbose_name='started at', blank=True)),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), ('finished', models.DateTimeField(help_text='Time of activity finalization.', null=True, verbose_name='finished at', blank=True)),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), ('succeeded', models.NullBooleanField(help_text='True, if the activity has finished successfully.')),
'node': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'instance_set'", 'null': 'True', 'to': u"orm['vm.Node']"}), ('result_data', jsonfield.fields.JSONField(help_text='Human readable result of activity.', null=True, verbose_name='result', blank=True)),
'num_cores': ('django.db.models.fields.IntegerField', [], {}), ('node', models.ForeignKey(related_name='activity_log', verbose_name='node', to='vm.Node', help_text='Node this activity works on.')),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), ('parent', models.ForeignKey(related_name='children', blank=True, to='vm.NodeActivity', null=True)),
'priority': ('django.db.models.fields.IntegerField', [], {}), ('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text='The person who started this activity.', null=True, verbose_name='user')),
'pw': ('django.db.models.fields.CharField', [], {'max_length': '20'}), ],
'ram_size': ('django.db.models.fields.IntegerField', [], {}), options={
'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'db_table': 'vm_nodeactivity',
'state': ('django.db.models.fields.CharField', [], {'default': "'NOSTATE'", 'max_length': '20'}),
'template': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'instance_set'", 'null': 'True', 'to': u"orm['vm.InstanceTemplate']"}),
'time_of_delete': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'time_of_suspend': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'})
}, },
u'vm.instanceactivity': { bases=(models.Model,),
'Meta': {'object_name': 'InstanceActivity'}, ),
'activity_code': ('django.db.models.fields.CharField', [], {'max_length': '100'}), migrations.CreateModel(
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), name='Trait',
'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), fields=[
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
'instance': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'activity_log'", 'to': u"orm['vm.Instance']"}), ('name', models.CharField(max_length=50, verbose_name='name')),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), ],
'result': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), options={
'started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'db_table': 'vm_trait',
'state': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '50'}),
'task_uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
}, },
u'vm.instancetemplate': { bases=(models.Model,),
'Meta': {'ordering': "['name']", 'object_name': 'InstanceTemplate'}, ),
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}), migrations.AddField(
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}), model_name='node',
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), name='traits',
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), field=models.ManyToManyField(help_text='Declared traits.', to='vm.Trait', verbose_name='traits', blank=True),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), preserve_default=True,
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'template_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}), ),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.AddField(
'lease': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'template_set'", 'to': u"orm['vm.Lease']"}), model_name='instancetemplate',
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}), name='lease',
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), field=models.ForeignKey(verbose_name='Lease', to='vm.Lease', help_text='Preferred expiration periods.'),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), preserve_default=True,
'num_cores': ('django.db.models.fields.IntegerField', [], {}), ),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.InstanceTemplate']", 'null': 'True', 'blank': 'True'}), migrations.AddField(
'priority': ('django.db.models.fields.IntegerField', [], {}), model_name='instancetemplate',
'ram_size': ('django.db.models.fields.IntegerField', [], {}), name='owner',
'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
'state': ('django.db.models.fields.CharField', [], {'default': "'NEW'", 'max_length': '10'}), preserve_default=True,
'system': ('django.db.models.fields.TextField', [], {'blank': 'True'}) ),
}, migrations.AddField(
u'vm.interface': { model_name='instancetemplate',
'Meta': {'object_name': 'Interface'}, name='parent',
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Host']", 'null': 'True', 'blank': 'True'}), field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='vm.InstanceTemplate', help_text='Template which this one is derived of.', null=True, verbose_name='parent template'),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), preserve_default=True,
'instance': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'interface_set'", 'to': u"orm['vm.Instance']"}), ),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vm_interface'", 'to': u"orm['firewall.Vlan']"}) migrations.AddField(
}, model_name='instancetemplate',
u'vm.interfacetemplate': { name='req_traits',
'Meta': {'object_name': 'InterfaceTemplate'}, field=models.ManyToManyField(help_text='A set of traits required for a node to declare to be suitable for hosting the VM.', to='vm.Trait', verbose_name='required traits', blank=True),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), preserve_default=True,
'managed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), ),
'template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'interface_set'", 'to': u"orm['vm.InstanceTemplate']"}), migrations.AddField(
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Vlan']"}) model_name='instancetemplate',
}, name='tags',
u'vm.lease': { field=taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='tags'),
'Meta': {'ordering': "['name']", 'object_name': 'Lease'}, preserve_default=True,
'delete_interval_seconds': ('django.db.models.fields.IntegerField', [], {}), ),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), migrations.AddField(
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), model_name='instance',
'suspend_interval_seconds': ('django.db.models.fields.IntegerField', [], {}) name='lease',
}, field=models.ForeignKey(verbose_name='Lease', to='vm.Lease', help_text='Preferred expiration periods.'),
u'vm.namedbaseresourceconfig': { preserve_default=True,
'Meta': {'object_name': 'NamedBaseResourceConfig'}, ),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}), migrations.AddField(
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), model_name='instance',
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), name='node',
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), field=models.ForeignKey(related_name='instance_set', blank=True, to='vm.Node', help_text='Current hypervisor of this instance.', null=True, verbose_name='host node'),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}), preserve_default=True,
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), ),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}), migrations.AddField(
'num_cores': ('django.db.models.fields.IntegerField', [], {}), model_name='instance',
'priority': ('django.db.models.fields.IntegerField', [], {}), name='owner',
'ram_size': ('django.db.models.fields.IntegerField', [], {}), field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) preserve_default=True,
}, ),
u'vm.node': { migrations.AddField(
'Meta': {'object_name': 'Node'}, model_name='instance',
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), name='req_traits',
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), field=models.ManyToManyField(help_text='A set of traits required for a node to declare to be suitable for hosting the VM.', to='vm.Trait', verbose_name='required traits', blank=True),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Host']"}), preserve_default=True,
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), migrations.AddField(
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}), model_name='instance',
'num_cores': ('django.db.models.fields.IntegerField', [], {}), name='tags',
'priority': ('django.db.models.fields.IntegerField', [], {}), field=taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='tags'),
'ram_size': ('django.db.models.fields.IntegerField', [], {}) preserve_default=True,
}, ),
u'vm.nodeactivity': { migrations.AddField(
'Meta': {'object_name': 'NodeActivity'}, model_name='instance',
'activity_code': ('django.db.models.fields.CharField', [], {'max_length': '100'}), name='template',
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), field=models.ForeignKey(related_name='instance_set', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='vm.InstanceTemplate', help_text='Template the instance derives from.', null=True, verbose_name='template'),
'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), preserve_default=True,
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), ),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), ]
'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'activity_log'", 'to': u"orm['vm.Node']"}),
'result': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '50'}),
'task_uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
}
}
complete_apps = ['vm']
\ No newline at end of file
...@@ -110,9 +110,8 @@ class VirtualMachineDescModel(BaseResourceConfigModel): ...@@ -110,9 +110,8 @@ class VirtualMachineDescModel(BaseResourceConfigModel):
"for hosting the VM."), "for hosting the VM."),
verbose_name=_("required traits")) verbose_name=_("required traits"))
system = TextField(verbose_name=_('operating system'), system = TextField(verbose_name=_('operating system'),
help_text=(_('Name of operating system in ' help_text=(_('Name of operating system in format like '
'format like "%s".') % '"Ubuntu 12.04 LTS Desktop amd64".')))
'Ubuntu 12.04 LTS Desktop amd64'))
tags = TaggableManager(blank=True, verbose_name=_("tags")) tags = TaggableManager(blank=True, verbose_name=_("tags"))
has_agent = BooleanField(verbose_name=_('has agent'), default=True, has_agent = BooleanField(verbose_name=_('has agent'), default=True,
help_text=_( help_text=_(
......
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'NamedBaseResourceConfig'
db.create_table(u'vm_namedbaseresourceconfig', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('max_ram_size', self.gf('django.db.models.fields.IntegerField')()),
('arch', self.gf('django.db.models.fields.CharField')(max_length=10)),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('boot_menu', self.gf('django.db.models.fields.BooleanField')(default=False)),
('raw_data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
))
db.send_create_signal(u'vm', ['NamedBaseResourceConfig'])
# Adding model 'Node'
db.create_table(u'vm_node', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Host'])),
('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal(u'vm', ['Node'])
# Adding model 'NodeActivity'
db.create_table(u'vm_nodeactivity', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('activity_code', self.gf('django.db.models.fields.CharField')(max_length=100)),
('task_uuid', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True, null=True, blank=True)),
('node', self.gf('django.db.models.fields.related.ForeignKey')(related_name='activity_log', to=orm['vm.Node'])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
('started', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('finished', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('result', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('status', self.gf('django.db.models.fields.CharField')(default='PENDING', max_length=50)),
))
db.send_create_signal(u'vm', ['NodeActivity'])
# Adding model 'Lease'
db.create_table(u'vm_lease', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
('suspend_interval_seconds', self.gf('django.db.models.fields.IntegerField')()),
('delete_interval_seconds', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal(u'vm', ['Lease'])
# Adding model 'InstanceTemplate'
db.create_table(u'vm_instancetemplate', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('max_ram_size', self.gf('django.db.models.fields.IntegerField')()),
('arch', self.gf('django.db.models.fields.CharField')(max_length=10)),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('boot_menu', self.gf('django.db.models.fields.BooleanField')(default=False)),
('raw_data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['vm.InstanceTemplate'], null=True, blank=True)),
('system', self.gf('django.db.models.fields.TextField')(blank=True)),
('access_method', self.gf('django.db.models.fields.CharField')(max_length=10)),
('state', self.gf('django.db.models.fields.CharField')(default='NEW', max_length=10)),
('lease', self.gf('django.db.models.fields.related.ForeignKey')(related_name='template_set', to=orm['vm.Lease'])),
))
db.send_create_signal(u'vm', ['InstanceTemplate'])
# Adding M2M table for field disks on 'InstanceTemplate'
m2m_table_name = db.shorten_name(u'vm_instancetemplate_disks')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('instancetemplate', models.ForeignKey(orm[u'vm.instancetemplate'], null=False)),
('disk', models.ForeignKey(orm[u'storage.disk'], null=False))
))
db.create_unique(m2m_table_name, ['instancetemplate_id', 'disk_id'])
# Adding model 'InterfaceTemplate'
db.create_table(u'vm_interfacetemplate', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Vlan'])),
('managed', self.gf('django.db.models.fields.BooleanField')(default=True)),
('template', self.gf('django.db.models.fields.related.ForeignKey')(related_name='interface_set', to=orm['vm.InstanceTemplate'])),
))
db.send_create_signal(u'vm', ['InterfaceTemplate'])
# Adding model 'Instance'
db.create_table(u'vm_instance', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('num_cores', self.gf('django.db.models.fields.IntegerField')()),
('ram_size', self.gf('django.db.models.fields.IntegerField')()),
('max_ram_size', self.gf('django.db.models.fields.IntegerField')()),
('arch', self.gf('django.db.models.fields.CharField')(max_length=10)),
('priority', self.gf('django.db.models.fields.IntegerField')()),
('boot_menu', self.gf('django.db.models.fields.BooleanField')(default=False)),
('raw_data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('template', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='instance_set', null=True, to=orm['vm.InstanceTemplate'])),
('pw', self.gf('django.db.models.fields.CharField')(max_length=20)),
('time_of_suspend', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)),
('time_of_delete', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)),
('active_since', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('node', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='instance_set', null=True, to=orm['vm.Node'])),
('state', self.gf('django.db.models.fields.CharField')(default='NOSTATE', max_length=20)),
('lease', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['vm.Lease'])),
('access_method', self.gf('django.db.models.fields.CharField')(max_length=10)),
('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal(u'vm', ['Instance'])
# Adding M2M table for field disks on 'Instance'
m2m_table_name = db.shorten_name(u'vm_instance_disks')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('instance', models.ForeignKey(orm[u'vm.instance'], null=False)),
('disk', models.ForeignKey(orm[u'storage.disk'], null=False))
))
db.create_unique(m2m_table_name, ['instance_id', 'disk_id'])
# Adding model 'InstanceActivity'
db.create_table(u'vm_instanceactivity', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('activity_code', self.gf('django.db.models.fields.CharField')(max_length=100)),
('task_uuid', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True, null=True, blank=True)),
('instance', self.gf('django.db.models.fields.related.ForeignKey')(related_name='activity_log', to=orm['vm.Instance'])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
('started', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('finished', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('result', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('state', self.gf('django.db.models.fields.CharField')(default='PENDING', max_length=50)),
))
db.send_create_signal(u'vm', ['InstanceActivity'])
# Adding model 'Interface'
db.create_table(u'vm_interface', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('vlan', self.gf('django.db.models.fields.related.ForeignKey')(related_name='vm_interface', to=orm['firewall.Vlan'])),
('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Host'], null=True, blank=True)),
('instance', self.gf('django.db.models.fields.related.ForeignKey')(related_name='interface_set', to=orm['vm.Instance'])),
))
db.send_create_signal(u'vm', ['Interface'])
def backwards(self, orm):
# Deleting model 'NamedBaseResourceConfig'
db.delete_table(u'vm_namedbaseresourceconfig')
# Deleting model 'Node'
db.delete_table(u'vm_node')
# Deleting model 'NodeActivity'
db.delete_table(u'vm_nodeactivity')
# Deleting model 'Lease'
db.delete_table(u'vm_lease')
# Deleting model 'InstanceTemplate'
db.delete_table(u'vm_instancetemplate')
# Removing M2M table for field disks on 'InstanceTemplate'
db.delete_table(db.shorten_name(u'vm_instancetemplate_disks'))
# Deleting model 'InterfaceTemplate'
db.delete_table(u'vm_interfacetemplate')
# Deleting model 'Instance'
db.delete_table(u'vm_instance')
# Removing M2M table for field disks on 'Instance'
db.delete_table(db.shorten_name(u'vm_instance_disks'))
# Deleting model 'InstanceActivity'
db.delete_table(u'vm_instanceactivity')
# Deleting model 'Interface'
db.delete_table(u'vm_interface')
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'firewall.domain': {
'Meta': {'object_name': 'Domain'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'ttl': ('django.db.models.fields.IntegerField', [], {'default': '600'})
},
u'firewall.group': {
'Meta': {'object_name': 'Group'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
},
u'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Vlan']"})
},
u'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Domain']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'network4': ('firewall.fields.IPNetworkField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'network6': ('firewall.fields.IPNetworkField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'reverse_domain': ('django.db.models.fields.TextField', [], {'default': "'%(d)d.%(c)d.%(b)d.%(a)d.in-addr.arpa'"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
},
u'storage.datastore': {
'Meta': {'ordering': "['name']", 'object_name': 'DataStore'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'storage.disk': {
'Meta': {'ordering': "['name']", 'object_name': 'Disk'},
'base': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'derivatives'", 'null': 'True', 'to': u"orm['storage.Disk']"}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'datastore': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['storage.DataStore']"}),
'dev_num': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'format': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'size': ('django.db.models.fields.IntegerField', [], {}),
'type': ('django.db.models.fields.CharField', [], {'max_length': '10'})
},
u'vm.instance': {
'Meta': {'ordering': "['pk']", 'object_name': 'Instance'},
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'active_since': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'instance_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.Lease']"}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'node': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'instance_set'", 'null': 'True', 'to': u"orm['vm.Node']"}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'pw': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "'NOSTATE'", 'max_length': '20'}),
'template': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'instance_set'", 'null': 'True', 'to': u"orm['vm.InstanceTemplate']"}),
'time_of_delete': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'time_of_suspend': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'})
},
u'vm.instanceactivity': {
'Meta': {'object_name': 'InstanceActivity'},
'activity_code': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instance': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'activity_log'", 'to': u"orm['vm.Instance']"}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'result': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '50'}),
'task_uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
},
u'vm.instancetemplate': {
'Meta': {'ordering': "['name']", 'object_name': 'InstanceTemplate'},
'access_method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'disks': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'template_set'", 'symmetrical': 'False', 'to': u"orm['storage.Disk']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lease': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'template_set'", 'to': u"orm['vm.Lease']"}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['vm.InstanceTemplate']", 'null': 'True', 'blank': 'True'}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "'NEW'", 'max_length': '10'}),
'system': ('django.db.models.fields.TextField', [], {'blank': 'True'})
},
u'vm.interface': {
'Meta': {'object_name': 'Interface'},
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Host']", 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instance': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'interface_set'", 'to': u"orm['vm.Instance']"}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vm_interface'", 'to': u"orm['firewall.Vlan']"})
},
u'vm.interfacetemplate': {
'Meta': {'object_name': 'InterfaceTemplate'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'managed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'interface_set'", 'to': u"orm['vm.InstanceTemplate']"}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Vlan']"})
},
u'vm.lease': {
'Meta': {'ordering': "['name']", 'object_name': 'Lease'},
'delete_interval_seconds': ('django.db.models.fields.IntegerField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'suspend_interval_seconds': ('django.db.models.fields.IntegerField', [], {})
},
u'vm.namedbaseresourceconfig': {
'Meta': {'object_name': 'NamedBaseResourceConfig'},
'arch': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'boot_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'max_ram_size': ('django.db.models.fields.IntegerField', [], {}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'ram_size': ('django.db.models.fields.IntegerField', [], {}),
'raw_data': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
},
u'vm.node': {
'Meta': {'object_name': 'Node'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['firewall.Host']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'num_cores': ('django.db.models.fields.IntegerField', [], {}),
'priority': ('django.db.models.fields.IntegerField', [], {}),
'ram_size': ('django.db.models.fields.IntegerField', [], {})
},
u'vm.nodeactivity': {
'Meta': {'object_name': 'NodeActivity'},
'activity_code': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'activity_log'", 'to': u"orm['vm.Node']"}),
'result': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '50'}),
'task_uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
}
}
complete_apps = ['vm']
\ No newline at end of file
amqp==1.4.5 amqp==1.4.6
anyjson==0.3.3 anyjson==0.3.3
billiard==3.3.0.17 billiard==3.3.0.18
bpython==0.12 bpython==0.13.1
celery==3.1.11 celery==3.1.16
Django==1.6.7 Django==1.7.3
django-appconf==0.6
django-autocomplete-light==1.4.14 django-autocomplete-light==1.4.14
django-braces==1.4.0 django-braces==1.4.0
django-celery==3.1.10 django-celery==3.1.16
django-crispy-forms==1.4.0 django-crispy-forms==1.4.0
django-model-utils==2.0.3 django-model-utils==2.2
django-sizefield==0.6 django-sizefield==0.6
django-sshkey==2.2.0 django-sshkey==2.2.0
django-statici18n==1.1 django-statici18n==1.1
django-tables2==0.15.0 django-tables2==0.15.0
django-taggit==0.12 django-taggit==0.12.2
docutils==0.11 docutils==0.12
Jinja2==2.7.2 Jinja2==2.7.3
jsonfield==0.9.20 jsonfield==1.0.0
kombu==3.0.15 kombu==3.0.23
logutils==0.3.3 logutils==0.3.3
MarkupSafe==0.21 MarkupSafe==0.23
netaddr==0.7.11 netaddr==0.7.12
pip-tools==0.3.4 pip-tools==0.3.5
psycopg2==2.5.2 psycopg2==2.5.4
Pygments==1.6 Pygments==1.6
pylibmc==1.3.0 pylibmc==1.3.0
python-dateutil==2.2 python-dateutil==2.2
pytz==2014.2 pyinotify==0.9.4
requests==2.2.1 pytz==2014.7
requests==2.4.3
salt==2014.1.0 salt==2014.1.0
simplejson==3.4.0 simplejson==3.6.5
six==1.6.1 six==1.8.0
slimit==0.8.1
South==0.8.4 South==0.8.4
sqlparse==0.1.11 sqlparse==0.1.13
pika==0.9.13 pika==0.9.14
Fabric==1.9.0 Fabric==1.10.0
lxml==3.3.5 lxml==3.4.0
pyinotify==0.9.4
git+https://github.com/BME-IK/django-pipeline.git git+https://github.com/BME-IK/django-pipeline.git
slimit==0.8.1
# Local development dependencies go here # Local development dependencies go here
-r base.txt -r base.txt
coverage==3.7.1 coverage==3.7.1
django-debug-toolbar==1.1 django-debug-toolbar==1.2.1
django-rosetta==0.7.4 django-rosetta==0.7.4
Sphinx==1.2.2 Sphinx==1.2.2
# Pro-tip: Try not to put anything here. There should be no dependency in # Pro-tip: Try not to put anything here. There should be no dependency in
# production that isn't in development. # production that isn't in development.
-r base.txt -r base.txt
uWSGI==2.0.4 uWSGI==2.0.8
# Test dependencies go here. # Test dependencies go here.
-r base.txt -r base.txt
coverage==3.7.1 coverage==3.7.1
factory-boy==2.3.1 factory-boy==2.4.1
mock==1.0.1 mock==1.0.1
django-nose==1.2 django-nose==1.2
nose==1.3.3 nose==1.3.4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment