Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Old basic cleanup

  • Loading branch information...
commit c226ede11b31e49b1a2dfa633c979bc54e35d11d 1 parent 66a691a
@Almad authored
Showing with 16 additions and 60 deletions.
  1. +2 −2 rpgrules/admin.py
  2. +12 −56 rpgrules/models.py
  3. +2 −2 setup.py
View
4 rpgrules/admin.py
@@ -1,5 +1,5 @@
from django.contrib import admin
-from djangobaselibrary.sample.models import Spam, Type
-admin.site.register([Spam, Type])
+from rpgrules.models import Rule
+admin.site.register(Rule)
View
68 rpgrules/models.py
@@ -1,60 +1,16 @@
from django.db import models
-from django.utils.translation import ugettext_lazy as _
+#from django.utils.translation import ugettext_lazy as _
-class Type(models.Model):
- '''
- just some model that will be refferenced by Spam
- '''
- name = models.CharField(max_length=255, unique=True)
- description = models.TextField(null=True, blank=True)
+class Rule(models.Model):
+ """
+ Rule is "rpg rule". As we're not so intrested into details as rpgdb, definition
+ of rule is 'something we want to create extensions for and take track for it'
- class Meta:
- verbose_name = _('Type')
- verbose_name_plural = _('Types')
-
- def __unicode__(self):
- return self.name
-
-class Spam(models.Model):
- '''
- sample model from http://south.aeracode.org/wiki/Tutorial
- '''
- weight = models.FloatField()
- expires = models.DateTimeField()
- name = models.CharField(max_length=255)
- count = models.IntegerField(null=True, blank=True)
- type = models.IntegerField()
-
- class Meta:
- unique_together = (('name', 'expires'),)
- verbose_name = _('Spam')
- verbose_name_plural = _('Spam')
-
- def __unicode__(self):
- return self.name
-
-
-# custom primary key testing
-# http://www.djangoproject.com/documentation/models/custom_pk/
-
-class Employee(models.Model):
- employee_code = models.CharField(max_length=10, primary_key=True, db_column='code')
- first_name = models.CharField(max_length=20)
- last_name = models.CharField(max_length=20)
-
- class Meta:
- ordering = ('last_name', 'first_name')
-
- def __unicode__(self):
- return u"%s %s" % (self.first_name, self.last_name)
-
-class Business(models.Model):
- name = models.CharField(max_length=20, primary_key=True)
- employees = models.ManyToManyField(Employee)
-
- class Meta:
- verbose_name_plural = 'businesses'
-
- def __unicode__(self):
- return self.name
+ Exact difference between where custom edition should be added and new rule
+ is left to admins.
+ Parent rule is used for hiearchy (as in 'DrD', 'DrD 1.6')
+ """
+ parent = models.ForeignKey('self', default=None, null=True, blank=True)
+ name = models.CharField(max_length=150)
+
View
4 setup.py
@@ -2,8 +2,8 @@
import rpgrules
setup(
- name = 'djangorpgrules',
- version = djangobaselibrary.__versionstr__,
+ name = 'rpgrules',
+ version = rpgrules.__versionstr__,
description = 'RPG Rules',
long_description = '\n'.join((
'RPG rules',
Please sign in to comment.
Something went wrong with that request. Please try again.