Ignore:
Timestamp:
Dec 12, 2011 11:47:52 AM (3 years ago)
Author:
yomguy <yomguy@…>
Branches:
master, crem, crem2, dev, dev2, diadems, feature/breadcrumbs, feature/ts-0.5, feature/ts-0.5.4, feature/writecache, forma, generic, instru_search, lam, lam2, mapsv3, merge, nlivemulti, production, release/1.4.4, sabiod, security, server, social, storage, telecaster, test, video
Children:
91bae44
Parents:
e60b787
git-author:
yomguy <yomguy@…> (12/12/2011 11:47:52)
git-committer:
yomguy <yomguy@…> (12/12/2011 11:47:52)
Message:

add revisions to admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telemeta/models/system.py

    r482c7bd r3f143f5  
    5656 
    5757    @classmethod 
    58     def touch(cls, element, user):     
     58    def touch(cls, element, user): 
    5959        "Create or update a revision" 
    60         revision = cls(element_type=element.element_type, element_id=element.pk,  
     60        revision = cls(element_type=element.element_type, element_id=element.pk, 
    6161                       user=user, change_type='create') 
    6262        if element.pk: 
    63             try:  
     63            try: 
    6464                element.__class__.objects.get(pk=element.pk) 
    6565            except ObjectDoesNotExist: 
     
    7171        return revision 
    7272 
     73    def __str__(self): 
     74        return str(self.time) + ' : ' + self.element_type + ' : ' + str(self.element_id) 
     75 
    7376    class Meta(MetaCore): 
    7477        db_table = 'revisions' 
     
    7780class UserProfile(django.db.models.Model): 
    7881    "User profile extension" 
    79      
     82 
    8083    user            = ForeignKey(User, unique=True, required=True) 
    8184    institution     = CharField(_('Institution')) 
     
    8487    telephone       = CharField(_('Telephone')) 
    8588    expiration_date = DateField(_('Expiration_date')) 
    86      
     89 
    8790    class Meta(MetaCore): 
    8891        db_table = 'profiles' 
Note: See TracChangeset for help on using the changeset viewer.