summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@animus.robocracy.org>2008-08-11 19:15:40 -0700
committerBryan Newbold <bnewbold@animus.robocracy.org>2008-08-11 19:15:40 -0700
commit36b0b1cc6eb6bfa135f131a48ab907db9302a42d (patch)
tree271bc0d3afa543d1ea22a67276d625313fb9abf5
parent70fcf5bd8e6c8ac5f058fded28613eff42b9c5e4 (diff)
downloadequator-36b0b1cc6eb6bfa135f131a48ab907db9302a42d.tar.gz
equator-36b0b1cc6eb6bfa135f131a48ab907db9302a42d.zip
django trunk update and changes; PARTIAL
-rw-r--r--equations/models.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/equations/models.py b/equations/models.py
index 6791eb2..7a5f8fe 100644
--- a/equations/models.py
+++ b/equations/models.py
@@ -7,7 +7,7 @@ from django.db.models import signals
from signals import update_render
class Symbol(models.Model):
- name = models.CharField(_("Name"), maxlength=256)
+ name = models.CharField(_("Name"), max_length=256)
latex = models.TextField(_("Raw LaTeX"), unique=True)
unicode = models.TextField(_("Unicode Representation"), blank=True)
renderdir = "symbolrenders/"
@@ -46,12 +46,14 @@ def update_generic_variable(sender, instance, signal, *args, **kwargs):
isgeneric=True)
genericv.save()
-dispatcher.connect(update_render, signal=signals.pre_save, sender=Symbol)
-dispatcher.connect(update_generic_variable, signal=signals.post_save,
- sender=Symbol)
+signals.pre_save.connect(update_render, sender=Symbol)
+signals.post_save.connect(update_generic_variable, sender=Symbol)
+#dispatcher.connect(update_render, signal=signals.pre_save, sender=Symbol)
+#dispatcher.connect(update_generic_variable, signal=signals.post_save,
+# sender=Symbol)
class Variable(models.Model):
- name = models.CharField(_("Name"), maxlength=256)
+ name = models.CharField(_("Name"), max_length=256)
latex = models.TextField(_("Raw LaTeX"), unique=True)
unicode = models.TextField(_("Unicode Representation"), blank=True)
description = models.TextField(_("Description"), blank=True)
@@ -78,10 +80,11 @@ class Variable(models.Model):
self.render = self.renderdir + "%s.png" % self.id
super(Variable, self).save()
-dispatcher.connect(update_render, signal=signals.pre_save, sender=Variable)
+signals.pre_save.connect(update_render, sender=Variable)
+#dispatcher.connect(update_render, signal=signals.pre_save, sender=Variable)
class Equation(models.Model):
- name = models.CharField(_("Name"), maxlength=256)
+ name = models.CharField(_("Name"), max_length=256)
latex = models.TextField(_("Raw LaTeX"), unique=True)
unicode = models.TextField(_("Unicode Representation"), blank=True)
description = models.TextField(_("Description"), blank=True)
@@ -116,5 +119,6 @@ class Equation(models.Model):
self.render = self.renderdir + "%s.png" % self.id
super(Equation, self).save()
+signals.post_save.connect(update_render, sender=Equation)
+#dispatcher.connect(update_render, signal=signals.post_save, sender=Equation)
-dispatcher.connect(update_render, signal=signals.post_save, sender=Equation)