Kevin Veroneau avatar Kevin Veroneau committed 8d6c3a4 Draft

Initial code commit into BitBucket.

Comments (0)

Files changed (37)

Empty file added.

+from django.contrib import admin
+from he_one.models import Host, NameSystem, UserPermission, Log, PCFile, Message,\
+    Mailbox, FilePermission, Objective, Mission, MissionObjectives, UserProfile,\
+    Task
+
+class NameSystemInline(admin.StackedInline):
+    model = NameSystem
+    extra = 0
+
+class HostInline(admin.TabularInline):
+    model = Host
+    extra = 0
+    exclude = ('mailboxes', 'logs',)
+    raw_id_fields = ('owner',)
+
+class UserPermissionInline(admin.TabularInline):
+    model = UserPermission
+    extra = 1
+    raw_id_fields = ('user',)
+
+class FilePermissionInline(admin.TabularInline):
+    model = FilePermission
+    extra = 1
+    raw_id_fields = ('creator',)
+
+class MissionObjectivesInline(admin.TabularInline):
+    model = MissionObjectives
+    extra = 1
+
+class NameSystemAdmin(admin.ModelAdmin):
+    prepopulated_fields = {'slug': ('hostname', 'domain',)}
+    list_display = ('__unicode__', 'slug', 'host',)
+
+class HostAdmin(admin.ModelAdmin):
+    inlines = [FilePermissionInline, UserPermissionInline, NameSystemInline, ]
+    list_display = ('ip', 'owner', 'is_router', 'is_booted', 'supports_mail', 'supports_web',)
+    list_filter = ('owner', 'is_router', 'is_booted', 'supports_mail', 'supports_web',)
+    search_fields = ['ip']
+    list_select_related = True
+    filter_horizontal = ['mailboxes', 'logs', 'mission_list']
+    raw_id_fields = ('owner',)
+    save_on_top = True
+    fieldsets = (
+        (None, {'fields': ('ip', 'gateway', 'owner',)}),
+        ('Options', {'fields': ('is_router', 'is_booted', 'supports_mail',)}),
+        ('HTTPSERV.PRG', {'classes': ('collapse',), 'fields': ('supports_web', 'supports_store', 'supports_download', 'supports_search',)}),
+        ('Mission Provider', {'classes': ('collapse',), 'fields': ('provides_missions', 'mission_list',)}),
+        ('Resources', {'classes': ('collapse',), 'fields': ('mailboxes', 'logs',)}),
+    )
+    def formfield_for_foreignkey(self, db_field, request, **kwargs):
+        if db_field.name == 'gateway':
+            kwargs['queryset'] = Host.objects.filter(is_router=True)
+        return super(HostAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
+
+class MissionAdmin(admin.ModelAdmin):
+    inlines = [MissionObjectivesInline, ]
+    list_display = ('title', 'level', 'cash', 'owner',)
+
+class LogAdmin(admin.ModelAdmin):
+    list_display = ('message', 'by_who', 'logged_at', 'deleted', )
+    list_filter = ('deleted', )
+
+class MailboxAdmin(admin.ModelAdmin):
+    filter_horizontal = ('messages', )
+
+class MessageAdmin(admin.ModelAdmin):
+    list_display = ('subject', 'from_user', 'to_user', )
+    filter_horizontal = ('attachments', )
+
+class UserPermissionAdmin(admin.ModelAdmin):
+    list_display = ('__unicode__', 'is_staff', 'is_superuser', )
+
+class ObjectiveAdmin(admin.ModelAdmin):
+    list_display = ('__unicode__', 'exp', )
+
+class PCFileAdmin(admin.ModelAdmin):
+    list_display = ('__unicode__', 'get_filesize', )
+
+admin.site.register(NameSystem, NameSystemAdmin)
+admin.site.register(Host, HostAdmin)
+admin.site.register(UserPermission, UserPermissionAdmin)
+admin.site.register(Log, LogAdmin)
+admin.site.register(PCFile, PCFileAdmin)
+admin.site.register(Message, MessageAdmin)
+admin.site.register(Mailbox, MailboxAdmin)
+admin.site.register(FilePermission)
+admin.site.register(Objective, ObjectiveAdmin)
+admin.site.register(Mission, MissionAdmin)
+admin.site.register(MissionObjectives)
+admin.site.register(UserProfile)
+admin.site.register(Task)

he_one/admin_views.py

+from django.http import HttpResponse
+from django.contrib.auth.decorators import login_required
+from he_one.models import Host, PCFile, FilePermission, NameSystem, Mission
+import datetime
+from django.contrib.auth.models import User
+from django.core.exceptions import PermissionDenied
+from django.shortcuts import redirect, get_object_or_404
+from django.views.generic.detail import DetailView
+from django.views.generic.list import ListView
+
+@login_required
+def bulk_create_hosts(req, network, low_range, high_range):
+    if not req.user.is_superuser:
+        raise PermissionDenied
+    owner = User.objects.get(username='nobody')
+    gw = Host.objects.get(ip="%s.1" % network)
+    krnl = PCFile.objects.get(filename='KERNEL', file_type='SYS')
+    for i in range(int(low_range), int(high_range)):
+        ip = "%s.%s" % (network, i)
+        host = Host.objects.create(ip=ip, gateway=gw, owner=owner)
+        FilePermission.objects.create(pcfile=krnl, host=host, creator=owner, create_date=datetime.datetime.now(), is_hidden=True, patch=0)
+    return HttpResponse("Job completed.")
+
+@login_required
+def admin_host(req, ip):
+    if not req.user.is_superuser:
+        raise PermissionDenied
+    host = get_object_or_404(Host, ip=ip)
+    return redirect('admin:he_one_host_change', str(host.pk))
+
+class AdminMixin(object):
+    def get(self, request, *args, **kwargs):
+        if not request.user.is_superuser:
+            raise PermissionDenied
+        return super(AdminMixin, self).get(request, *args, **kwargs)
+
+class ResolveDNS(AdminMixin, DetailView):
+    model = NameSystem
+    def get_object(self, queryset=None):
+        return self.get_queryset().get(hostname=self.kwargs['hostname'], domain=self.kwargs['domain'])
+
+class ShowDomain(AdminMixin, ListView):
+    model = NameSystem
+    def get_context_data(self, **kwargs):
+        context = super(ShowDomain, self).get_context_data(**kwargs)
+        context.update({'domain':self.kwargs['domain']})
+        return context
+    def get_queryset(self):
+        return super(ShowDomain, self).get_queryset().filter(domain=self.kwargs['domain']).select_related()
+
+class UserInfo(AdminMixin, DetailView):
+    model = User
+    template_name = "he_one/user_info.html"
+    def get_object(self, queryset=None):
+        return self.get_queryset().get(username=self.kwargs['username'])
+
+class MissionList(AdminMixin, ListView):
+    model = Mission
+
+class MissionDetail(AdminMixin, DetailView):
+    model = Mission
+    def get_queryset(self):
+        return super(MissionDetail, self).get_queryset().select_related()
+from dajax.core import Dajax
+from dajaxice.decorators import dajaxice_register
+from django.contrib.auth.decorators import login_required
+from django.contrib.auth.models import User
+from he_one.models import Host, UserPermission, Mailbox, FilePermission, Log
+from django.contrib import messages
+import datetime
+
+class Ajax(Dajax):
+    def append_message(self, tag, message):
+        self.add_data({'tag':tag, 'message':message}, 'append_message')
+    def error(self, message):
+        self.append_message('error', message)
+        return self.json()
+    def success(self, message):
+        self.append_message('info', message)
+        return self.json()
+
+@dajaxice_register(method='GET')
+def message_push(req):
+    dajax = Ajax()
+    dajax.error('Some informational.')
+    return dajax.json()
+
+@login_required
+@dajaxice_register(name='host.user_perms')
+def add_user(req, username, perm_set={}):
+    dajax = Ajax()
+    log = Log(by_who=req.user, logged_at=datetime.datetime.now())
+    try:
+        user = User.objects.get(username=username)
+    except User.DoesNotExist:
+        return dajax.error('User does not exist.')
+    if 'host_ip' not in perm_set:
+        return dajax.error('No Host IP address specified.')
+    try:
+        host = Host.objects.get(owner=req.user, ip=perm_set['host_ip'])
+    except Host.DoesNotExist:
+        return dajax.error('The specified host could not be found under your ownership.')
+    try:
+        perms = UserPermission.objects.get(user=user, host=host)
+        if 'is_staff' in perm_set:
+            perms.is_staff = perm_set['is_staff']
+        if 'is_superuser' in perm_set:
+            perms.is_superuser = perm_set['is_superuser']
+        perms.save()
+        log.message = "Updated permissions on user %s" % username
+        log.save()
+        host.logs.add(log)
+        return dajax.success('The user permissions have been updated.')
+    except UserPermission.DoesNotExist:
+        UserPermission.objects.create(user=user, host=host, is_staff=perm_set.get('is_staff', False), is_superuser=perm_set.get('is_superuser', False))
+    log.message = "Added user %s" % username
+    log.save()
+    host.logs.add(log)
+    messages.success(req, "User was added successfully.")
+    dajax.redirect(host.get_absolute_url())
+    return dajax.json()
+
+@login_required
+@dajaxice_register(name='host.add_mailbox')
+def add_mailbox(req, username, host_ip):
+    dajax = Ajax()
+    log = Log(by_who=req.user, logged_at=datetime.datetime.now())
+    try:
+        user = User.objects.get(username=username)
+    except User.DoesNotExist:
+        return dajax.error('User does not exist.')
+    try:
+        host = Host.objects.get(owner=req.user, ip=host_ip)
+    except Host.DoesNotExist:
+        return dajax.error('The specified host could not be found under your ownership.')
+    if not host.supports_mail:
+        return dajax.error('This host does not support mail routing.')
+    try:
+        host.mailboxes.get(owner=user)
+        return dajax.error('A mailbox already exists for this user.')
+    except Mailbox.DoesNotExist:
+        mbx = Mailbox.objects.create(owner=user)
+        mbx.messages.create(from_user=req.user, to_user=user, subject="Welcome to %s" % host, body="Welcome to your new mailbox!")
+        host.mailboxes.add(mbx)
+    log.message = "Created Mailbox for %s" % username
+    log.save()
+    host.logs.add(log)
+    messages.success(req, "Mailbox was added successfully.")
+    dajax.redirect(host.get_absolute_url())
+    return dajax.json()
+
+@login_required
+@dajaxice_register(name='host.rm_mailbox')
+def rm_mailbox(req, mbx_id, host_ip):
+    dajax = Ajax()
+    log = Log(by_who=req.user, logged_at=datetime.datetime.now())
+    try:
+        host = Host.objects.get(owner=req.user, ip=host_ip)
+    except Host.DoesNotExist:
+        return dajax.error('The specified host could not be found under your ownership.')
+    if not host.supports_mail:
+        return dajax.error('This host does not support mail routing.')
+    try:
+        mbx = host.mailboxes.get(pk=mbx_id)
+    except Mailbox.DoesNotExist:
+        return dajax.error('This mailbox does not exist on this host.')
+    mbx.messages.all().delete()
+    log.message = "Deleted Mailbox for %s" % mbx.owner
+    mbx.delete()
+    log.save()
+    host.logs.add(log)
+    messages.success(req, "Mailbox was deleted successfully.")
+    dajax.redirect(host.get_absolute_url())
+    return dajax.json()
+
+@login_required
+@dajaxice_register(name='host.rm_file')
+def rm_pcfile(req, file_id):
+    dajax = Ajax()
+    log = Log(by_who=req.user, logged_at=datetime.datetime.now())
+    try:
+        pcfile = FilePermission.objects.get(pk=file_id)
+    except FilePermission.DoesNotExist:
+        return dajax.error('The specified file does not exist.')
+    host = pcfile.host
+    if host.owner != req.user:
+        log.message = "Attempted to delete %s" % pcfile.pcfile
+        log.save()
+        host.logs.add(log)
+        return dajax.error('You do not have such permissions to this host.')
+    log.message = "Deleted file %s" % pcfile.pcfile
+    pcfile.delete()
+    log.save()
+    host.logs.add(log)
+    messages.success(req, "File has been deleted.")
+    dajax.redirect(host.get_absolute_url())
+    return dajax.json()
+
+@login_required
+@dajaxice_register(name='host.rm_log')
+def rm_pclog(req, log_id, host_ip):
+    dajax = Ajax()
+    try:
+        host = Host.objects.get(owner=req.user, ip=host_ip)
+    except Host.DoesNotExist:
+        return dajax.error('The specified host could not be found under your ownership.')
+    if log_id == 'ALL':
+        host.logs.all().delete()
+        messages.success(req, "All Logs have been cleared.")
+        dajax.redirect(host.get_absolute_url())
+        return dajax.json()
+    try:
+        log = host.logs.get(pk=log_id)
+    except Log.DoesNotExist:
+        return dajax.error('The log you attempted to delete does not exist.')
+    log.delete()
+    messages.success(req, "Log has been deleted.")
+    dajax.redirect(host.get_absolute_url())
+    return dajax.json()

he_one/context_processors.py

+from django.core.cache import cache
+from he_one.forms import AddressBarForm
+from forums.forms import ForumSearchForm
+
+def user_profile(req):
+    if req.user.is_authenticated():
+        profile = cache.get("profile-%s" % req.user.pk)
+        return {'profile':profile}
+    return {}
+
+def lookup_forms(req):
+    return {'addrbar_form':AddressBarForm(), 'forumsearch_form':ForumSearchForm()}
+
+def user_tools(req):
+    if req.user.is_authenticated():
+        user_tools = cache.get("usertools-%s" % req.user.pk)
+        return {'user_tools':user_tools}
+    return {}
+from django import forms
+from selectable.forms.widgets import AutoCompleteWidget
+from he_one.lookups import HostLookup
+
+class AddressBarForm(forms.Form):
+    addrbar = forms.CharField(
+        label='Address Bar',
+        widget=AutoCompleteWidget(HostLookup),
+        required=False,
+    )

he_one/lookups.py

+from selectable.base import ModelLookup
+from he_one.models import NameSystem
+from selectable.decorators import ajax_required, login_required
+from selectable.registry import registry
+
+@ajax_required
+@login_required
+class HostLookup(ModelLookup):
+    model = NameSystem
+    search_fields = ('domain__startswith','hostname__startswith',)
+    def get_item_value(self, item):
+        return item.get_ipaddr()
+
+registry.register(HostLookup)

he_one/managers.py

+from django.db import models
+import random
+
+def generate_ip(network):
+    return "%s.%s" % (network, random.randint(2,254))
+
+class HostManager(models.Manager):
+    def create_host(self, owner, network='192.168.0'):
+        host = self.model(ip=generate_ip(network), owner=owner, is_router=False, is_booted=False, supports_mail=False)
+        host.save()
+        return host

he_one/middleware.py

+from django.core.cache import cache
+from he_one.models import UserProfile, Host, NameSystem, FilePermission, Task
+from django.contrib import messages
+from django.http import HttpResponseRedirect
+from django.contrib.auth.models import User
+from django.shortcuts import redirect
+from django.template.defaultfilters import slugify
+import datetime
+
+class ProfileMiddleware(object):
+    def process_request(self, req):
+        if not req.user.is_authenticated():
+            if req.path[0:8] == '/he_one/' or req.path == '/Tutorial':
+                return HttpResponseRedirect('/accounts/login/?next=%s' % req.path)
+            return None
+        profile = cache.get('profile-%s' % req.user.pk)
+        if profile == None:
+            try:
+                profile = UserProfile.objects.get(user=req.user)
+            except UserProfile.DoesNotExist:
+                profile = UserProfile(user=req.user, tutorial=0, exp=0, cash=0)
+                profile.save()
+            cache.set('profile-%s' % req.user.pk, profile)
+        if req.path[0:8] != '/he_one/' and req.path != '/Tutorial':
+            return None
+        if profile.tutorial == 1:
+            nobody = User.objects.get(username='nobody')
+            try:
+                host = Host.objects.filter(owner=nobody)[0]
+                host.owner = req.user
+                host.save()
+                messages.info(req, "You have been assigned a host!")
+                gwdns = NameSystem.objects.get(host=host.gateway)
+                NameSystem.objects.create(host=host, hostname=req.user.username, domain=gwdns.domain, slug=slugify("%s-%s" % (req.user.username, gwdns.domain)))
+                FilePermission.objects.filter(host=host).update(creator=req.user)
+                profile.tutorial += 1
+                profile.home_host = host
+                profile.save()
+                return redirect(host)
+            except IndexError:
+                messages.info(req, "No hosts are available at this time.")
+        if profile.tutorial < 1:
+            if req.path != '/Tutorial':
+                messages.info(req, "Welcome to Hacker's Edge %s!" % req.user.username)
+                return HttpResponseRedirect('/Tutorial')
+            profile.tutorial += 1
+            profile.save()
+
+class TaskMiddleware(object):
+    def process_request(self, req):
+        if not req.user.is_authenticated():
+            return None
+        for task in Task.objects.filter(owner=req.user, end_time__lt=datetime.datetime.now()):
+            if task.content_type.model == 'filepermission':
+                pm = task.target
+                pcfile = pm.pcfile
+                if task.host == task.target_host:
+                    pm.deleted = True
+                    pm.save()
+                    task.target_host.logs.create(by_who=req.user, message="Deleted file %s" % pcfile, logged_at=task.end_time)
+                    messages.success(req, "%s has been deleted." % pcfile)
+                else:
+                    if task.is_download:
+                        FilePermission.objects.create(host=task.host, pcfile=pcfile, creator=pm.creator, create_date=pm.create_date, patch=pm.patch)
+                        task.target_host.logs.create(by_who=req.user, message="Downloaded %s to %s" % (pcfile, task.host), logged_at=task.end_time)
+                        messages.info(req, "%s has been downloaded." % pcfile)
+                        if task.is_delete:
+                            pm.deleted = True
+                            pm.save()
+                            task.target_host.logs.create(by_who=req.user, message="Deleted file %s" % (pcfile), logged_at=task.end_time)
+                    else:
+                        FilePermission.objects.create(host=task.target_host, pcfile=pcfile, creator=pm.creator, create_date=pm.create_date, patch=pm.patch)
+                        task.target_host.logs.create(by_who=req.user, message="Uploaded %s from %s" % (pcfile, task.host), logged_at=task.end_time)
+                        messages.info(req, "%s has been uploaded." % pcfile)
+                        if task.is_delete:
+                            pm.deleted = True
+                            pm.save()
+                            task.host.logs.create(by_who=req.user, message="Deleted file %s" % (pcfile), logged_at=task.end_time)
+            elif task.content_type.model == 'log':
+                pclog = task.target
+                pclog.deleted = True
+                pclog.save()
+                messages.success(req, "Log has been deleted from %s" % task.target_host)
+            task.delete()
+
+class ToolsMiddleware(object):
+    def process_request(self, req):
+        if not req.user.is_authenticated():
+            return None
+        profile = cache.get('profile-%s' % req.user.pk)
+        if profile == None:
+            return None
+        user_tools = cache.get('usertools-%s' % req.user.pk)
+        if user_tools == None:
+            user_tools = []
+            host = profile.home_host
+            if host == None:
+                return None
+            for pcfile in host.files.filter(file_type='PRG', filepermission__deleted=False):
+                user_tools.append(pcfile.filename)
+        print user_tools
+        cache.set('usertools-%s' % req.user.pk, user_tools)
+        req.user_tools = user_tools

he_one/migrations/0001_initial.py

+# -*- 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 'Host'
+        db.create_table('he_one_host', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('ip', self.gf('django.db.models.fields.IPAddressField')(unique=True, max_length=15, db_index=True)),
+            ('gateway', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Host'], null=True, blank=True)),
+            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='hosts', to=orm['auth.User'])),
+            ('is_router', self.gf('django.db.models.fields.BooleanField')(default=False)),
+        ))
+        db.send_create_signal('he_one', ['Host'])
+
+        # Adding model 'UserPermission'
+        db.create_table('he_one_userpermission', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+            ('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Host'])),
+            ('is_staff', self.gf('django.db.models.fields.BooleanField')(default=False)),
+            ('is_superuser', self.gf('django.db.models.fields.BooleanField')(default=False)),
+        ))
+        db.send_create_signal('he_one', ['UserPermission'])
+
+        # Adding model 'NameSystem'
+        db.create_table('he_one_namesystem', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('hostname', self.gf('django.db.models.fields.CharField')(max_length=20)),
+            ('domain', self.gf('django.db.models.fields.CharField')(max_length=30)),
+            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=51)),
+            ('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Host'])),
+        ))
+        db.send_create_signal('he_one', ['NameSystem'])
+
+        # Adding unique constraint on 'NameSystem', fields ['hostname', 'domain']
+        db.create_unique('he_one_namesystem', ['hostname', 'domain'])
+
+
+    def backwards(self, orm):
+        # Removing unique constraint on 'NameSystem', fields ['hostname', 'domain']
+        db.delete_unique('he_one_namesystem', ['hostname', 'domain'])
+
+        # Deleting model 'Host'
+        db.delete_table('he_one_host')
+
+        # Deleting model 'UserPermission'
+        db.delete_table('he_one_userpermission')
+
+        # Deleting model 'NameSystem'
+        db.delete_table('he_one_namesystem')
+
+
+    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'})
+        },
+        'he_one.host': {
+            'Meta': {'object_name': 'Host'},
+            'gateway': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']", 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'ip': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
+            'is_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': "orm['auth.User']"}),
+            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['he_one.UserPermission']", 'symmetrical': 'False'})
+        },
+        'he_one.namesystem': {
+            'Meta': {'unique_together': "(('hostname', 'domain'),)", 'object_name': 'NameSystem'},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'hostname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '51'})
+        },
+        'he_one.userpermission': {
+            'Meta': {'object_name': 'UserPermission'},
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        }
+    }
+
+    complete_apps = ['he_one']

he_one/migrations/0002_auto__add_missionobjectives__add_mailbox__add_pcfile__add_objective__a.py

+# -*- 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 'MissionObjectives'
+        db.create_table('he_one_missionobjectives', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('objective', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Objective'])),
+            ('mission', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Mission'])),
+            ('order', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
+        ))
+        db.send_create_signal('he_one', ['MissionObjectives'])
+
+        # Adding model 'Mailbox'
+        db.create_table('he_one_mailbox', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+        ))
+        db.send_create_signal('he_one', ['Mailbox'])
+
+        # Adding M2M table for field messages on 'Mailbox'
+        db.create_table('he_one_mailbox_messages', (
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('mailbox', models.ForeignKey(orm['he_one.mailbox'], null=False)),
+            ('message', models.ForeignKey(orm['he_one.message'], null=False))
+        ))
+        db.create_unique('he_one_mailbox_messages', ['mailbox_id', 'message_id'])
+
+        # Adding model 'PCFile'
+        db.create_table('he_one_pcfile', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('filename', self.gf('django.db.models.fields.CharField')(max_length=8)),
+            ('file_type', self.gf('django.db.models.fields.CharField')(max_length=3)),
+            ('content', self.gf('django.db.models.fields.TextField')()),
+        ))
+        db.send_create_signal('he_one', ['PCFile'])
+
+        # Adding model 'Objective'
+        db.create_table('he_one_objective', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
+            ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
+            ('action', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
+            ('is_object', self.gf('django.db.models.fields.BooleanField')(default=False)),
+            ('exp', self.gf('django.db.models.fields.PositiveIntegerField')()),
+        ))
+        db.send_create_signal('he_one', ['Objective'])
+
+        # Adding model 'Mission'
+        db.create_table('he_one_mission', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('title', self.gf('django.db.models.fields.CharField')(max_length=80)),
+            ('description', self.gf('django.db.models.fields.TextField')()),
+            ('level', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
+            ('cash', self.gf('django.db.models.fields.PositiveIntegerField')()),
+            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+        ))
+        db.send_create_signal('he_one', ['Mission'])
+
+        # Adding model 'FilePermission'
+        db.create_table('he_one_filepermission', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('pcfile', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.PCFile'])),
+            ('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Host'])),
+            ('creator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+            ('create_date', self.gf('django.db.models.fields.DateTimeField')()),
+            ('is_hidden', self.gf('django.db.models.fields.BooleanField')(default=False)),
+            ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)),
+            ('patch', self.gf('django.db.models.fields.IntegerField')()),
+        ))
+        db.send_create_signal('he_one', ['FilePermission'])
+
+        # Adding model 'Message'
+        db.create_table('he_one_message', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('from_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='sent_set', to=orm['auth.User'])),
+            ('to_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+            ('subject', self.gf('django.db.models.fields.CharField')(max_length=80)),
+            ('body', self.gf('django.db.models.fields.TextField')()),
+        ))
+        db.send_create_signal('he_one', ['Message'])
+
+        # Adding M2M table for field attachments on 'Message'
+        db.create_table('he_one_message_attachments', (
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('message', models.ForeignKey(orm['he_one.message'], null=False)),
+            ('pcfile', models.ForeignKey(orm['he_one.pcfile'], null=False))
+        ))
+        db.create_unique('he_one_message_attachments', ['message_id', 'pcfile_id'])
+
+        # Adding model 'Log'
+        db.create_table('he_one_log', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('by_who', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+            ('message', self.gf('django.db.models.fields.CharField')(max_length=80)),
+            ('logged_at', self.gf('django.db.models.fields.DateTimeField')()),
+            ('deleted', self.gf('django.db.models.fields.BooleanField')(default=False)),
+        ))
+        db.send_create_signal('he_one', ['Log'])
+
+        # Adding field 'Host.is_booted'
+        db.add_column('he_one_host', 'is_booted',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding field 'Host.supports_mail'
+        db.add_column('he_one_host', 'supports_mail',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding M2M table for field mailboxes on 'Host'
+        db.create_table('he_one_host_mailboxes', (
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('host', models.ForeignKey(orm['he_one.host'], null=False)),
+            ('mailbox', models.ForeignKey(orm['he_one.mailbox'], null=False))
+        ))
+        db.create_unique('he_one_host_mailboxes', ['host_id', 'mailbox_id'])
+
+        # Adding M2M table for field logs on 'Host'
+        db.create_table('he_one_host_logs', (
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('host', models.ForeignKey(orm['he_one.host'], null=False)),
+            ('log', models.ForeignKey(orm['he_one.log'], null=False))
+        ))
+        db.create_unique('he_one_host_logs', ['host_id', 'log_id'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'MissionObjectives'
+        db.delete_table('he_one_missionobjectives')
+
+        # Deleting model 'Mailbox'
+        db.delete_table('he_one_mailbox')
+
+        # Removing M2M table for field messages on 'Mailbox'
+        db.delete_table('he_one_mailbox_messages')
+
+        # Deleting model 'PCFile'
+        db.delete_table('he_one_pcfile')
+
+        # Deleting model 'Objective'
+        db.delete_table('he_one_objective')
+
+        # Deleting model 'Mission'
+        db.delete_table('he_one_mission')
+
+        # Deleting model 'FilePermission'
+        db.delete_table('he_one_filepermission')
+
+        # Deleting model 'Message'
+        db.delete_table('he_one_message')
+
+        # Removing M2M table for field attachments on 'Message'
+        db.delete_table('he_one_message_attachments')
+
+        # Deleting model 'Log'
+        db.delete_table('he_one_log')
+
+        # Deleting field 'Host.is_booted'
+        db.delete_column('he_one_host', 'is_booted')
+
+        # Deleting field 'Host.supports_mail'
+        db.delete_column('he_one_host', 'supports_mail')
+
+        # Removing M2M table for field mailboxes on 'Host'
+        db.delete_table('he_one_host_mailboxes')
+
+        # Removing M2M table for field logs on 'Host'
+        db.delete_table('he_one_host_logs')
+
+
+    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'})
+        },
+        'he_one.filepermission': {
+            'Meta': {'object_name': 'FilePermission'},
+            'create_date': ('django.db.models.fields.DateTimeField', [], {}),
+            'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'patch': ('django.db.models.fields.IntegerField', [], {}),
+            'pcfile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.PCFile']"})
+        },
+        'he_one.host': {
+            'Meta': {'object_name': 'Host'},
+            'files': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.PCFile']", 'through': "orm['he_one.FilePermission']", 'symmetrical': 'False'}),
+            'gateway': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']", 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'ip': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
+            'is_booted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'logs': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Log']", 'null': 'True', 'blank': 'True'}),
+            'mailboxes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Mailbox']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': "orm['auth.User']"}),
+            'supports_mail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['he_one.UserPermission']", 'symmetrical': 'False'})
+        },
+        'he_one.log': {
+            'Meta': {'object_name': 'Log'},
+            'by_who': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'logged_at': ('django.db.models.fields.DateTimeField', [], {}),
+            'message': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.mailbox': {
+            'Meta': {'object_name': 'Mailbox'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'messages': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Message']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.message': {
+            'Meta': {'object_name': 'Message'},
+            'attachments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.PCFile']", 'null': 'True', 'blank': 'True'}),
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sent_set'", 'to': "orm['auth.User']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'subject': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
+            'to_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.mission': {
+            'Meta': {'object_name': 'Mission'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'level': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'objectives': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.Objective']", 'through': "orm['he_one.MissionObjectives']", 'symmetrical': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.missionobjectives': {
+            'Meta': {'object_name': 'MissionObjectives'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'mission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Mission']"}),
+            'objective': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Objective']"}),
+            'order': ('django.db.models.fields.PositiveSmallIntegerField', [], {})
+        },
+        'he_one.namesystem': {
+            'Meta': {'unique_together': "(('hostname', 'domain'),)", 'object_name': 'NameSystem'},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'hostname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '51'})
+        },
+        'he_one.objective': {
+            'Meta': {'object_name': 'Objective'},
+            'action': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_object': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
+        },
+        'he_one.pcfile': {
+            'Meta': {'object_name': 'PCFile'},
+            'content': ('django.db.models.fields.TextField', [], {}),
+            'file_type': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
+            'filename': ('django.db.models.fields.CharField', [], {'max_length': '8'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+        },
+        'he_one.userpermission': {
+            'Meta': {'object_name': 'UserPermission'},
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        }
+    }
+
+    complete_apps = ['he_one']

he_one/migrations/0003_auto__add_userprofile.py

+# -*- 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 'UserProfile'
+        db.create_table('he_one_userprofile', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
+            ('tutorial', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
+            ('exp', self.gf('django.db.models.fields.PositiveIntegerField')()),
+            ('cash', self.gf('django.db.models.fields.PositiveIntegerField')()),
+            ('urlconf', self.gf('django.db.models.fields.CharField')(max_length=60)),
+        ))
+        db.send_create_signal('he_one', ['UserProfile'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'UserProfile'
+        db.delete_table('he_one_userprofile')
+
+
+    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'})
+        },
+        'he_one.filepermission': {
+            'Meta': {'object_name': 'FilePermission'},
+            'create_date': ('django.db.models.fields.DateTimeField', [], {}),
+            'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'patch': ('django.db.models.fields.IntegerField', [], {}),
+            'pcfile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.PCFile']"})
+        },
+        'he_one.host': {
+            'Meta': {'object_name': 'Host'},
+            'files': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.PCFile']", 'through': "orm['he_one.FilePermission']", 'symmetrical': 'False'}),
+            'gateway': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']", 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'ip': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
+            'is_booted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'logs': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Log']", 'null': 'True', 'blank': 'True'}),
+            'mailboxes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Mailbox']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': "orm['auth.User']"}),
+            'supports_mail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['he_one.UserPermission']", 'symmetrical': 'False'})
+        },
+        'he_one.log': {
+            'Meta': {'object_name': 'Log'},
+            'by_who': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'logged_at': ('django.db.models.fields.DateTimeField', [], {}),
+            'message': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.mailbox': {
+            'Meta': {'object_name': 'Mailbox'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'messages': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Message']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.message': {
+            'Meta': {'object_name': 'Message'},
+            'attachments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.PCFile']", 'null': 'True', 'blank': 'True'}),
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sent_set'", 'to': "orm['auth.User']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'subject': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
+            'to_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.mission': {
+            'Meta': {'object_name': 'Mission'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'level': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'objectives': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.Objective']", 'through': "orm['he_one.MissionObjectives']", 'symmetrical': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.missionobjectives': {
+            'Meta': {'object_name': 'MissionObjectives'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'mission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Mission']"}),
+            'objective': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Objective']"}),
+            'order': ('django.db.models.fields.PositiveSmallIntegerField', [], {})
+        },
+        'he_one.namesystem': {
+            'Meta': {'unique_together': "(('hostname', 'domain'),)", 'object_name': 'NameSystem'},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'hostname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '51'})
+        },
+        'he_one.objective': {
+            'Meta': {'object_name': 'Objective'},
+            'action': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_object': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
+        },
+        'he_one.pcfile': {
+            'Meta': {'object_name': 'PCFile'},
+            'content': ('django.db.models.fields.TextField', [], {}),
+            'file_type': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
+            'filename': ('django.db.models.fields.CharField', [], {'max_length': '8'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+        },
+        'he_one.userpermission': {
+            'Meta': {'object_name': 'UserPermission'},
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.userprofile': {
+            'Meta': {'object_name': 'UserProfile'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'tutorial': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'urlconf': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
+            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
+        }
+    }
+
+    complete_apps = ['he_one']

he_one/migrations/0004_auto__del_field_userprofile_urlconf.py

+# -*- 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):
+        # Deleting field 'UserProfile.urlconf'
+        db.delete_column('he_one_userprofile', 'urlconf')
+
+
+    def backwards(self, orm):
+        # Adding field 'UserProfile.urlconf'
+        db.add_column('he_one_userprofile', 'urlconf',
+                      self.gf('django.db.models.fields.CharField')(default='hedemos.urls', max_length=60),
+                      keep_default=False)
+
+
+    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'})
+        },
+        'he_one.filepermission': {
+            'Meta': {'object_name': 'FilePermission'},
+            'create_date': ('django.db.models.fields.DateTimeField', [], {}),
+            'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'patch': ('django.db.models.fields.IntegerField', [], {}),
+            'pcfile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.PCFile']"})
+        },
+        'he_one.host': {
+            'Meta': {'object_name': 'Host'},
+            'files': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.PCFile']", 'through': "orm['he_one.FilePermission']", 'symmetrical': 'False'}),
+            'gateway': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']", 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'ip': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
+            'is_booted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'logs': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Log']", 'null': 'True', 'blank': 'True'}),
+            'mailboxes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Mailbox']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': "orm['auth.User']"}),
+            'supports_mail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['he_one.UserPermission']", 'symmetrical': 'False'})
+        },
+        'he_one.log': {
+            'Meta': {'object_name': 'Log'},
+            'by_who': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'logged_at': ('django.db.models.fields.DateTimeField', [], {}),
+            'message': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.mailbox': {
+            'Meta': {'object_name': 'Mailbox'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'messages': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Message']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.message': {
+            'Meta': {'object_name': 'Message'},
+            'attachments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.PCFile']", 'null': 'True', 'blank': 'True'}),
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sent_set'", 'to': "orm['auth.User']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'subject': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
+            'to_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.mission': {
+            'Meta': {'object_name': 'Mission'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'level': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'objectives': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.Objective']", 'through': "orm['he_one.MissionObjectives']", 'symmetrical': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.missionobjectives': {
+            'Meta': {'object_name': 'MissionObjectives'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'mission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Mission']"}),
+            'objective': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Objective']"}),
+            'order': ('django.db.models.fields.PositiveSmallIntegerField', [], {})
+        },
+        'he_one.namesystem': {
+            'Meta': {'unique_together': "(('hostname', 'domain'),)", 'object_name': 'NameSystem'},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'hostname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '51'})
+        },
+        'he_one.objective': {
+            'Meta': {'object_name': 'Objective'},
+            'action': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_object': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
+        },
+        'he_one.pcfile': {
+            'Meta': {'object_name': 'PCFile'},
+            'content': ('django.db.models.fields.TextField', [], {}),
+            'file_type': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
+            'filename': ('django.db.models.fields.CharField', [], {'max_length': '8'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+        },
+        'he_one.userpermission': {
+            'Meta': {'object_name': 'UserPermission'},
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.userprofile': {
+            'Meta': {'object_name': 'UserProfile'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'tutorial': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
+        }
+    }
+
+    complete_apps = ['he_one']

he_one/migrations/0005_auto__add_task.py

+# -*- 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 'Task'
+        db.create_table('he_one_task', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+            ('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Host'])),
+            ('end_time', self.gf('django.db.models.fields.DateTimeField')()),
+            ('target_host', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='remote_tasks', null=True, to=orm['he_one.Host'])),
+            ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
+            ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
+            ('is_download', self.gf('django.db.models.fields.BooleanField')(default=False)),
+            ('is_delete', self.gf('django.db.models.fields.BooleanField')(default=False)),
+        ))
+        db.send_create_signal('he_one', ['Task'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'Task'
+        db.delete_table('he_one_task')
+
+
+    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'})
+        },
+        'he_one.filepermission': {
+            'Meta': {'object_name': 'FilePermission'},
+            'create_date': ('django.db.models.fields.DateTimeField', [], {}),
+            'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'patch': ('django.db.models.fields.IntegerField', [], {}),
+            'pcfile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.PCFile']"})
+        },
+        'he_one.host': {
+            'Meta': {'object_name': 'Host'},
+            'files': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.PCFile']", 'through': "orm['he_one.FilePermission']", 'symmetrical': 'False'}),
+            'gateway': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']", 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'ip': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
+            'is_booted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'logs': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Log']", 'null': 'True', 'blank': 'True'}),
+            'mailboxes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Mailbox']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': "orm['auth.User']"}),
+            'supports_mail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['he_one.UserPermission']", 'symmetrical': 'False'})
+        },
+        'he_one.log': {
+            'Meta': {'object_name': 'Log'},
+            'by_who': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'logged_at': ('django.db.models.fields.DateTimeField', [], {}),
+            'message': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.mailbox': {
+            'Meta': {'object_name': 'Mailbox'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'messages': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Message']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.message': {
+            'Meta': {'object_name': 'Message'},
+            'attachments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.PCFile']", 'null': 'True', 'blank': 'True'}),
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sent_set'", 'to': "orm['auth.User']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'subject': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
+            'to_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.mission': {
+            'Meta': {'object_name': 'Mission'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'level': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'objectives': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.Objective']", 'through': "orm['he_one.MissionObjectives']", 'symmetrical': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.missionobjectives': {
+            'Meta': {'object_name': 'MissionObjectives'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'mission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Mission']"}),
+            'objective': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Objective']"}),
+            'order': ('django.db.models.fields.PositiveSmallIntegerField', [], {})
+        },
+        'he_one.namesystem': {
+            'Meta': {'unique_together': "(('hostname', 'domain'),)", 'object_name': 'NameSystem'},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'hostname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '51'})
+        },
+        'he_one.objective': {
+            'Meta': {'object_name': 'Objective'},
+            'action': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_object': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
+        },
+        'he_one.pcfile': {
+            'Meta': {'object_name': 'PCFile'},
+            'content': ('django.db.models.fields.TextField', [], {}),
+            'file_type': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
+            'filename': ('django.db.models.fields.CharField', [], {'max_length': '8'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+        },
+        'he_one.task': {
+            'Meta': {'object_name': 'Task'},
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'end_time': ('django.db.models.fields.DateTimeField', [], {}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_delete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_download': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'target_host': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'remote_tasks'", 'null': 'True', 'to': "orm['he_one.Host']"})
+        },
+        'he_one.userpermission': {
+            'Meta': {'object_name': 'UserPermission'},
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.userprofile': {
+            'Meta': {'object_name': 'UserProfile'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'tutorial': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
+        }
+    }
+
+    complete_apps = ['he_one']

he_one/migrations/0006_auto__add_field_host_supports_web__add_field_host_supports_store__add_.py

+# -*- 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 field 'Host.supports_web'
+        db.add_column('he_one_host', 'supports_web',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding field 'Host.supports_store'
+        db.add_column('he_one_host', 'supports_store',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding field 'Host.supports_download'
+        db.add_column('he_one_host', 'supports_download',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding field 'Host.supports_search'
+        db.add_column('he_one_host', 'supports_search',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding field 'Host.provides_missions'
+        db.add_column('he_one_host', 'provides_missions',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding M2M table for field mission_list on 'Host'
+        db.create_table('he_one_host_mission_list', (
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('host', models.ForeignKey(orm['he_one.host'], null=False)),
+            ('mission', models.ForeignKey(orm['he_one.mission'], null=False))
+        ))
+        db.create_unique('he_one_host_mission_list', ['host_id', 'mission_id'])
+
+        # Adding field 'FilePermission.is_public'
+        db.add_column('he_one_filepermission', 'is_public',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+        # Adding field 'FilePermission.cost'
+        db.add_column('he_one_filepermission', 'cost',
+                      self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True),
+                      keep_default=False)
+
+
+    def backwards(self, orm):
+        # Deleting field 'Host.supports_web'
+        db.delete_column('he_one_host', 'supports_web')
+
+        # Deleting field 'Host.supports_store'
+        db.delete_column('he_one_host', 'supports_store')
+
+        # Deleting field 'Host.supports_download'
+        db.delete_column('he_one_host', 'supports_download')
+
+        # Deleting field 'Host.supports_search'
+        db.delete_column('he_one_host', 'supports_search')
+
+        # Deleting field 'Host.provides_missions'
+        db.delete_column('he_one_host', 'provides_missions')
+
+        # Removing M2M table for field mission_list on 'Host'
+        db.delete_table('he_one_host_mission_list')
+
+        # Deleting field 'FilePermission.is_public'
+        db.delete_column('he_one_filepermission', 'is_public')
+
+        # Deleting field 'FilePermission.cost'
+        db.delete_column('he_one_filepermission', 'cost')
+
+
+    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'})
+        },
+        'he_one.filepermission': {
+            'Meta': {'object_name': 'FilePermission'},
+            'cost': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'create_date': ('django.db.models.fields.DateTimeField', [], {}),
+            'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'patch': ('django.db.models.fields.IntegerField', [], {}),
+            'pcfile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.PCFile']"})
+        },
+        'he_one.host': {
+            'Meta': {'object_name': 'Host'},
+            'files': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.PCFile']", 'through': "orm['he_one.FilePermission']", 'symmetrical': 'False'}),
+            'gateway': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']", 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'ip': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
+            'is_booted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'logs': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Log']", 'null': 'True', 'blank': 'True'}),
+            'mailboxes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Mailbox']", 'null': 'True', 'blank': 'True'}),
+            'mission_list': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.Mission']", 'symmetrical': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': "orm['auth.User']"}),
+            'provides_missions': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'supports_download': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'supports_mail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'supports_search': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'supports_store': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'supports_web': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['he_one.UserPermission']", 'symmetrical': 'False'})
+        },
+        'he_one.log': {
+            'Meta': {'object_name': 'Log'},
+            'by_who': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'logged_at': ('django.db.models.fields.DateTimeField', [], {}),
+            'message': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.mailbox': {
+            'Meta': {'object_name': 'Mailbox'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'messages': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.Message']", 'null': 'True', 'blank': 'True'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.message': {
+            'Meta': {'object_name': 'Message'},
+            'attachments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['he_one.PCFile']", 'null': 'True', 'blank': 'True'}),
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sent_set'", 'to': "orm['auth.User']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'subject': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
+            'to_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.mission': {
+            'Meta': {'object_name': 'Mission'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'level': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'objectives': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['he_one.Objective']", 'through': "orm['he_one.MissionObjectives']", 'symmetrical': 'False'}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
+        },
+        'he_one.missionobjectives': {
+            'Meta': {'object_name': 'MissionObjectives'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'mission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Mission']"}),
+            'objective': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Objective']"}),
+            'order': ('django.db.models.fields.PositiveSmallIntegerField', [], {})
+        },
+        'he_one.namesystem': {
+            'Meta': {'unique_together': "(('hostname', 'domain'),)", 'object_name': 'NameSystem'},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'hostname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '51'})
+        },
+        'he_one.objective': {
+            'Meta': {'object_name': 'Objective'},
+            'action': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_object': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
+        },
+        'he_one.pcfile': {
+            'Meta': {'object_name': 'PCFile'},
+            'content': ('django.db.models.fields.TextField', [], {}),
+            'file_type': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
+            'filename': ('django.db.models.fields.CharField', [], {'max_length': '8'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+        },
+        'he_one.task': {
+            'Meta': {'object_name': 'Task'},
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'end_time': ('django.db.models.fields.DateTimeField', [], {}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_delete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_download': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'target_host': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'remote_tasks'", 'null': 'True', 'to': "orm['he_one.Host']"})
+        },
+        'he_one.userpermission': {
+            'Meta': {'object_name': 'UserPermission'},
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+        },
+        'he_one.userprofile': {
+            'Meta': {'object_name': 'UserProfile'},
+            'cash': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'exp': ('django.db.models.fields.PositiveIntegerField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'tutorial': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
+            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
+        }
+    }
+
+    complete_apps = ['he_one']

he_one/migrations/0007_auto__add_field_userprofile_home_host.py

+# -*- 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 field 'UserProfile.home_host'
+        db.add_column('he_one_userprofile', 'home_host',
+                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['he_one.Host'], null=True, blank=True),
+                      keep_default=False)
+
+
+    def backwards(self, orm):
+        # Deleting field 'UserProfile.home_host'
+        db.delete_column('he_one_userprofile', 'home_host_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'}),
+            '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'})
+        },
+        'he_one.filepermission': {
+            'Meta': {'object_name': 'FilePermission'},
+            'cost': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'create_date': ('django.db.models.fields.DateTimeField', [], {}),
+            'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.Host']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'patch': ('django.db.models.fields.IntegerField', [], {}),
+            'pcfile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['he_one.PCFile']"})
+        },