summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2007-12-29 18:21:10 -0800
committereliott <eliott@cactuswax.net>2007-12-29 18:21:10 -0800
commit706152de89a8c64ebbfb6d91bcafe7a8616f4cef (patch)
tree619feb7b8fd09eef6e05ec5662d846461de269ec /devel
parent89659cef5f309d7eb6bc6ca3d4ab84b779c6728d (diff)
Moved some things around.
Diffstat (limited to 'devel')
-rw-r--r--devel/models.py56
-rw-r--r--devel/templatetags/__init__.py0
-rw-r--r--devel/templatetags/validation.py15
-rw-r--r--devel/views.py4
4 files changed, 73 insertions, 2 deletions
diff --git a/devel/models.py b/devel/models.py
new file mode 100644
index 00000000..d78989f5
--- /dev/null
+++ b/devel/models.py
@@ -0,0 +1,56 @@
+from django.db import models
+from django.contrib.auth.models import User
+
+class Mirror(models.Model):
+ id = models.AutoField(primary_key=True)
+ domain = models.CharField(maxlength=255)
+ country = models.CharField(maxlength=255)
+ url = models.CharField(maxlength=255)
+ protocol_list = models.CharField(maxlength=255, null=True, blank=True)
+ admin_email = models.CharField(maxlength=255, null=True, blank=True)
+ def __str__(self):
+ return self.domain
+ class Meta:
+ db_table = 'common_mirror'
+ class Admin:
+ list_display = ('domain', 'country')
+ list_filter = ('country',)
+ ordering = ['domain']
+ search_fields = ('domain')
+ pass
+
+class Donator(models.Model):
+ id = models.AutoField(primary_key=True)
+ name = models.CharField(maxlength=255)
+ def __str__(self):
+ return self.name
+ class Meta:
+ db_table = 'common_donator'
+ class Admin:
+ ordering = ['name']
+ search_fields = ('name')
+ pass
+
+class UserProfile(models.Model):
+ id = models.AutoField(primary_key=True) # not technically needed
+ notify = models.BooleanField("Send notifications", default=True, help_text="When enabled, user will recieve 'flag out of date' notifications")
+ alias = models.CharField(core=True, maxlength=50, help_text="Required field")
+ public_email = models.CharField(core=True, maxlength=50, help_text="Required field")
+ other_contact = models.CharField(maxlength=100, null=True, blank=True)
+ website = models.URLField(null=True, blank=True)
+ yob = models.IntegerField(null=True, blank=True)
+ location = models.CharField(maxlength=50, null=True, blank=True)
+ languages = models.CharField(maxlength=50, null=True, blank=True)
+ interests = models.CharField(maxlength=255, null=True, blank=True)
+ occupation = models.CharField(maxlength=50, null=True, blank=True)
+ roles = models.CharField(maxlength=255, null=True, blank=True)
+ favorite_distros = models.CharField(maxlength=255, null=True, blank=True)
+ picture = models.FileField(upload_to='devs', default='devs/silhouette.png')
+ user = models.ForeignKey(User, edit_inline=models.STACKED, num_in_admin=1, min_num_in_admin=1, max_num_in_admin=1, num_extra_on_change=0, unique=True)
+ class Meta:
+ db_table = 'user_profiles'
+ verbose_name = 'Additional Profile Data'
+ verbose_name_plural = 'Additional Profile Data'
+
+# vim: set ts=4 sw=4 et:
+
diff --git a/devel/templatetags/__init__.py b/devel/templatetags/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/devel/templatetags/__init__.py
diff --git a/devel/templatetags/validation.py b/devel/templatetags/validation.py
new file mode 100644
index 00000000..38a40531
--- /dev/null
+++ b/devel/templatetags/validation.py
@@ -0,0 +1,15 @@
+from django import template
+
+register = template.Library()
+
+@register.inclusion_tag('errors.html')
+def print_errors(errors):
+ errs = []
+ for e,msg in errors.iteritems():
+ errmsg = str(msg[0])
+ # hack -- I'm a python idiot
+ errs.append( (e, errmsg[2:-2]) )
+ return {'errors': errs}
+
+# vim: set ts=4 sw=4 et:
+
diff --git a/devel/views.py b/devel/views.py
index c2cdb706..19a7cdfd 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -6,8 +6,8 @@ from archweb_dev.lib.utils import render_response
from archweb_dev.packages.models import Package
from archweb_dev.todolists.models import Todolist, TodolistPkg
from archweb_dev.settings import DATA_DIR
-from archweb_dev.utils import validate
-from archweb_dev.public.models import UserProfile
+from archweb_dev.lib.utils import validate
+from archweb_dev.devel.models import UserProfile
@login_required
def index(request):