Changeset 1544 for trunk/pylucid/PyLucid/models.py
- Timestamp:
- 04/30/08 13:35:20 (23 months ago)
- Files:
-
- 1 modified
-
trunk/pylucid/PyLucid/models.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/PyLucid/models.py
r1538 r1544 542 542 543 543 def __unicode__(self): 544 return self.plugin_name.replace("_"," ") 545 544 txt = u"%s - %s" % (self.package_name, self.plugin_name) 545 return txt.replace(u"_",u" ") 546 547 #______________________________________________________________________________ 548 # Preference 546 549 547 550 class Preference(models.Model): 551 """ 552 Stores preferences 553 554 Any pickleable Python object can be stored. 555 556 Use a small cache, so the pickle.loads() method would only be used on the 557 first access. 558 559 Note: 560 - This model has no Admin class. Because it makes no sense to edit 561 pickled data strings in the django admin panel ;) 562 """ 563 plugin = models.ForeignKey("Plugin", help_text="The associated plugin") 564 repr_string = models.TextField( 565 help_text="printable representation of the newform data dictionary" 566 ) 567 568 lastupdatetime = models.DateTimeField(auto_now=True, editable=False) 569 lastupdateby = models.ForeignKey( 570 User, null=True, blank=True, editable=False, 571 ) 572 573 #__________________________________________________________________________ 574 575 def __unicode__(self): 576 return u"Preference object for '%s'" % self.plugin 577 578 class Admin: 579 pass 580 581 class Meta: 582 # Use a new table 583 db_table = u'PyLucid_preference2' 584 585 586 class PreferenceOld(models.Model): 548 587 """ 549 588 Stores preferences for the PyLucid system and all Plugins. … … 648 687 lastupdateby = models.ForeignKey( 649 688 User, null=True, blank=True, editable=False, 650 related_name="preferences_lastupdateby",651 689 ) 652 690 … … 669 707 return "%s '%s'" % (self.plugin, self.name) 670 708 709 class Meta: 710 # Use the old table 711 db_table = u'PyLucid_preference' 712 713 714 #______________________________________________________________________________ 671 715 672 716