admin of UsableResource, allow charge parent to be null, tabular display of charge
[raven.git] / apps / billingsystem / billing / models.py
index 30b88f2..081ede0 100644 (file)
@@ -63,12 +63,14 @@ class ChargeState(models.Model):
 class Charge(models.Model):
     account = models.ForeignKey(Account)
     object = models.ForeignKey(UsableResource)
-    parent = models.ForeignKey('self', blank=True, related_name="children")
+    parent = models.ForeignKey('self', blank=True, null=True, related_name="children")
     kind = models.ForeignKey(ChargeKind)
     state = models.ForeignKey(ChargeState)
     date = models.DateTimeField()
     amount = models.FloatField(default=0.0)
     coreHours = models.FloatField(default=0.0)
+    def __unicode__(self):
+        return unicode(self.pk)