Commit d1afb6a1 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Progress I

parent 4220c386
......@@ -26,5 +26,69 @@
"fields": {
"name": "helpdesk"
}
},
{
"model": "auth.group",
"pk": 4,
"fields": {
"name": "faculty"
},
"permissions": ""
},
{
"model": "auth.group",
"pk": 4,
"fields": {
"name": "ugrad"
}
},
{
"model": "auth.group",
"pk": 4,
"fields": {
"name": "grad"
}
},
{
"model": "auth.group",
"pk": 4,
"fields": {
"name": "researcher"
}
},
{
"model": "auth.group",
"pk": 4,
"fields": {
"name": "associate"
}
},
{
"model": "im.GroupKind",
"pk": 1,
"fields": {
"name": "course"
}
},
{
"model": "im.GroupKind",
"pk": 2,
"fields": {
"name": "project"
}
},
{
"model": "im.GroupKind",
"pk": 3,
"fields": {
"name": "laboratory"
}
},
{
"model": "im.GroupKind",
"pk": 4,
"fields": {
"name": "organization"
}
}
]
......@@ -46,8 +46,10 @@ from django.utils.functional import lazy
from django.utils.safestring import mark_safe
from django.contrib import messages
from django.utils.encoding import smart_str
from django.forms.extras.widgets import SelectDateWidget
from django.db.models import Q
from astakos.im.models import AstakosUser, Invitation, get_latest_terms, EmailChange
from astakos.im.models import *
from astakos.im.settings import INVITATIONS_PER_LEVEL, DEFAULT_FROM_EMAIL, \
BASEURL, SITENAME, RECAPTCHA_PRIVATE_KEY, DEFAULT_CONTACT_EMAIL, \
RECAPTCHA_ENABLED, LOGGING_LEVEL
......@@ -484,4 +486,44 @@ class ExtendedPasswordChangeForm(PasswordChangeForm):
user.renew_token()
if commit:
user.save()
return user
\ No newline at end of file
return user
def get_astakos_group_creation_form(request):
class AstakosGroupCreationForm(forms.ModelForm):
issue_date = forms.DateField(widget=SelectDateWidget())
expiration_date = forms.DateField(widget=SelectDateWidget())
kind = forms.ModelChoiceField(queryset=GroupKind.objects.all(), empty_label=None)
class Meta:
model = AstakosGroup
def __init__(self, *args, **kwargs):
super(AstakosGroupCreationForm, self).__init__(*args, **kwargs)
self.fields.keyOrder = ['kind', 'name', 'identifier', 'desc', 'issue_date',
'expiration_date', 'estimated_participants',
'moderatation_enabled']
def save(self, commit=True):
g = super(AstakosGroupCreationForm, self).save(commit=False)
if commit:
g.save()
g.owner = [request.user]
return g
return AstakosGroupCreationForm
def get_astakos_group_policy_creation_form(group):
class AstakosGroupPolicyCreationForm(forms.ModelForm):
choices = Resource.objects.filter(~Q(astakosgroup=group))
resource = forms.ModelChoiceField(queryset=choices, empty_label=None)
class Meta:
model = AstakosGroupQuota
def __init__(self, *args, **kwargs):
if not args:
args = ({'group':group},)
super(AstakosGroupPolicyCreationForm, self).__init__(*args, **kwargs)
self.fields['group'].widget.attrs['disabled'] = True
return AstakosGroupPolicyCreationForm
\ No newline at end of file
# Copyright 2012 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
import socket
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from astakos.im.models import Resource, ResourceMetadata, Service
class Command(BaseCommand):
args = "<service> <resource> [<key>=<value>...]"
help = "Add a resource"
def handle(self, *args, **options):
if len(args) < 2:
raise CommandError("Invalid number of arguments")
service_name = args[0]
resource_name = args[1]
try:
service = Service.objects.get(name=service_name)
except Service.DoesNotExist:
raise CommandError("Invalid service name")
else:
try:
resource = Resource(name=resource_name, service=service)
resource.save()
except IntegrityError, e:
raise CommandError(e)
# else:
# resource.meta.add(args[2:])
\ No newline at end of file
# encoding: 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 'GroupKind'
db.create_table('im_groupkind', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255, db_index=True)),
))
db.send_create_signal('im', ['GroupKind'])
# Adding model 'AstakosGroup'
db.create_table('im_astakosgroup', (
('group_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.Group'], unique=True, primary_key=True)),
('kind', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.GroupKind'])),
('desc', self.gf('django.db.models.fields.TextField')(null=True)),
('identifier', self.gf('django.db.models.fields.URLField')(default='', unique=True, max_length=200, db_index=True)),
('creation_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2012, 8, 2, 22, 23, 54, 131886))),
('issue_date', self.gf('django.db.models.fields.DateTimeField')(null=True)),
('expiration_date', self.gf('django.db.models.fields.DateTimeField')(null=True)),
('moderatation_enabled', self.gf('django.db.models.fields.BooleanField')(default=False)),
('approval_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('estimated_participants', self.gf('django.db.models.fields.PositiveIntegerField')(null=True)),
))
db.send_create_signal('im', ['AstakosGroup'])
# Adding model 'ResourceMetadata'
db.create_table('im_resourcemetadata', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255, db_index=True)),
('value', self.gf('django.db.models.fields.CharField')(max_length=255)),
))
db.send_create_signal('im', ['ResourceMetadata'])
# Adding model 'Resource'
db.create_table('im_resource', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255, db_index=True)),
('service', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Service'])),
))
db.send_create_signal('im', ['Resource'])
# Adding M2M table for field meta on 'Resource'
db.create_table('im_resource_meta', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('resource', models.ForeignKey(orm['im.resource'], null=False)),
('resourcemetadata', models.ForeignKey(orm['im.resourcemetadata'], null=False))
))
db.create_unique('im_resource_meta', ['resource_id', 'resourcemetadata_id'])
# Adding model 'AstakosUserQuota'
db.create_table('im_astakosuserquota', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('limit', self.gf('django.db.models.fields.PositiveIntegerField')()),
('resource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Resource'])),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosUser'])),
))
db.send_create_signal('im', ['AstakosUserQuota'])
# Adding model 'Membership'
db.create_table('im_membership', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosUser'])),
('group', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosGroup'])),
('date_requested', self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2012, 8, 2, 22, 23, 54, 135644))),
('date_joined', self.gf('django.db.models.fields.DateField')(null=True, db_index=True)),
))
db.send_create_signal('im', ['Membership'])
# Adding unique constraint on 'Membership', fields ['person', 'group']
db.create_unique('im_membership', ['person_id', 'group_id'])
# Adding model 'AstakosGroupQuota'
db.create_table('im_astakosgroupquota', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('limit', self.gf('django.db.models.fields.PositiveIntegerField')()),
('resource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Resource'])),
('group', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosGroup'])),
))
db.send_create_signal('im', ['AstakosGroupQuota'])
# Adding index on 'Service', fields ['name']
db.create_index('im_service', ['name'])
# Adding M2M table for field owner on 'AstakosUser'
db.create_table('im_astakosuser_owner', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('astakosuser', models.ForeignKey(orm['im.astakosuser'], null=False)),
('astakosgroup', models.ForeignKey(orm['im.astakosgroup'], null=False))
))
db.create_unique('im_astakosuser_owner', ['astakosuser_id', 'astakosgroup_id'])
def backwards(self, orm):
# Removing index on 'Service', fields ['name']
db.delete_index('im_service', ['name'])
# Removing unique constraint on 'Membership', fields ['person', 'group']
db.delete_unique('im_membership', ['person_id', 'group_id'])
# Deleting model 'GroupKind'
db.delete_table('im_groupkind')
# Deleting model 'AstakosGroup'
db.delete_table('im_astakosgroup')
# Deleting model 'ResourceMetadata'
db.delete_table('im_resourcemetadata')
# Deleting model 'Resource'
db.delete_table('im_resource')
# Removing M2M table for field meta on 'Resource'
db.delete_table('im_resource_meta')
# Deleting model 'AstakosUserQuota'
db.delete_table('im_astakosuserquota')
# Deleting model 'Membership'
db.delete_table('im_membership')
# Deleting model 'AstakosGroupQuota'
db.delete_table('im_astakosgroupquota')
# Removing M2M table for field owner on 'AstakosUser'
db.delete_table('im_astakosuser_owner')
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'})
},
'im.additionalmail': {
'Meta': {'object_name': 'AdditionalMail'},
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
},
'im.approvalterms': {
'Meta': {'object_name': 'ApprovalTerms'},
'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 8, 2, 22, 23, 54, 137733)', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
},
'im.astakosgroup': {
'Meta': {'object_name': 'AstakosGroup', '_ormbases': ['auth.Group']},
'approval_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 8, 2, 22, 23, 54, 131886)'}),
'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
'estimated_participants': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'group_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.Group']", 'unique': 'True', 'primary_key': 'True'}),
'identifier': ('django.db.models.fields.URLField', [], {'default': "''", 'unique': 'True', 'max_length': '200', 'db_index': 'True'}),
'issue_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'kind': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.GroupKind']"}),
'moderatation_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'policy': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosGroupQuota']", 'blank': 'True'})
},
'im.astakosgroupquota': {
'Meta': {'object_name': 'AstakosGroupQuota'},
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosGroup']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'limit': ('django.db.models.fields.PositiveIntegerField', [], {}),
'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"})
},
'im.astakosuser': {
'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
'activation_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'astakos_groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.AstakosGroup']", 'symmetrical': 'False', 'through': "orm['im.Membership']", 'blank': 'True'}),
'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'invitations': ('django.db.models.fields.IntegerField', [], {'default': '100'}),
'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'owner': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'owner'", 'null': 'True', 'to': "orm['im.AstakosGroup']"}),
'policy': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosUserQuota']", 'symmetrical': 'False'}),
'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'updated': ('django.db.models.fields.DateTimeField', [], {}),
'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
},
'im.astakosuserquota': {
'Meta': {'object_name': 'AstakosUserQuota'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'limit': ('django.db.models.fields.PositiveIntegerField', [], {}),
'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
},
'im.emailchange': {
'Meta': {'object_name': 'EmailChange'},
'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'requested_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 8, 2, 22, 23, 54, 139243)'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchange_user'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
},
'im.groupkind': {
'Meta': {'object_name': 'GroupKind'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
},
'im.invitation': {
'Meta': {'object_name': 'Invitation'},
'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
},
'im.membership': {
'Meta': {'unique_together': "(('person', 'group'),)", 'object_name': 'Membership'},
'date_joined': ('django.db.models.fields.DateField', [], {'null': 'True', 'db_index': 'True'}),
'date_requested': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 8, 2, 22, 23, 54, 135644)'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosGroup']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
},
'im.resource': {
'Meta': {'object_name': 'Resource'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'meta': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.ResourceMetadata']", 'symmetrical': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
'service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Service']"})
},
'im.resourcemetadata': {
'Meta': {'object_name': 'ResourceMetadata'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
},
'im.service': {
'Meta': {'object_name': 'Service'},
'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'icon': ('django.db.models.fields.FilePathField', [], {'max_length': '100', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
'url': ('django.db.models.fields.FilePathField', [], {'max_length': '100'})
}
}
complete_apps = ['im']
# encoding: 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 unique constraint on 'AstakosGroupQuota', fields ['group', 'resource']
db.create_unique('im_astakosgroupquota', ['group_id', 'resource_id'])
# Adding unique constraint on 'AstakosUserQuota', fields ['resource', 'user']
db.create_unique('im_astakosuserquota', ['resource_id', 'user_id'])
def backwards(self, orm):
# Removing unique constraint on 'AstakosUserQuota', fields ['resource', 'user']
db.delete_unique('im_astakosuserquota', ['resource_id', 'user_id'])
# Removing unique constraint on 'AstakosGroupQuota', fields ['group', 'resource']
db.delete_unique('im_astakosgroupquota', ['group_id', 'resource_id'])
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'}),