Changeset 7ed402e


Ignore:
Timestamp:
Feb 20, 2012 4:58:37 PM (3 years ago)
Author:
yomguy <yomguy@…>
Branches:
master, crem, crem2, crem3, dev, dev2, diadems, dj1.6, 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, search, security, server, social, storage, telecaster, test
Children:
9290fec
Parents:
9f838ba
git-author:
yomguy <yomguy@…> (20/02/2012 16:58:37)
git-committer:
yomguy <yomguy@…> (20/02/2012 16:58:37)
Message:

add Format (LAM) and various enumerations, add last revision to item detail

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • README.rst

    r9f838ba r7ed402e  
    8686    $ git clone http://vcs.parisson.com/git/telemeta.git 
    8787 
    88 Licence 
     88License 
    8989======= 
    9090 
  • telemeta/admin.py

    rd5b2406 r7ed402e  
    7474    ordering = ['-time'] 
    7575 
     76class FormatAdmin(admin.ModelAdmin): 
     77    search_fields = ['code', 'vendor'] 
    7678 
    7779admin.site.register(MediaFonds, MediaFondsAdmin) 
     
    9799 
    98100admin.site.register(Revision, RevisionAdmin) 
     101 
     102admin.site.register(Format, FormatAdmin) 
  • telemeta/models/enum.py

    r9acae9b r7ed402e  
    4040    "Abstract enumerations base class" 
    4141    value = CharField(_('value'), required=True, unique=True) 
    42      
     42 
    4343    def __unicode__(self): 
    4444        return self.value 
     
    7878        verbose_name = _("record author") 
    7979 
    80 class MetadataWriter(Enumeration):   
     80class MetadataWriter(Enumeration): 
    8181    "Collection metadata writer" 
    8282 
     
    8686 
    8787class LegalRight(Enumeration): 
    88     "Collection legal rights"  
     88    "Collection legal rights" 
    8989 
    9090    class Meta(MetaEnumeration): 
     
    127127        verbose_name = _("keyword") 
    128128 
    129 class Publisher(Enumeration):  
     129class Publisher(Enumeration): 
    130130    "Collection publisher" 
    131131 
     
    154154 
    155155class EthnicGroupAlias(ModelCore): 
    156     "Item ethnic group other name"  
     156    "Item ethnic group other name" 
    157157    ethnic_group = ForeignKey('EthnicGroup', related_name="aliases", verbose_name=_('population / social group')) 
    158158    value        = CharField(_('name'), required=True) 
     
    163163        ordering = ['ethnic_group__value'] 
    164164 
     165# Tape formats 
     166class TapeLength(Enumeration): 
     167    "Tape length (cm)" 
    165168 
     169    class Meta(MetaEnumeration): 
     170        db_table = 'tape_length' 
     171        verbose_name = _("tape length (cm)") 
     172 
     173class TapeWidth(Enumeration): 
     174    "Tape width (inch)" 
     175 
     176    class Meta(MetaEnumeration): 
     177        db_table = 'tape_width' 
     178        verbose_name = _("tape width (inch)") 
     179 
     180class TapeSpeed(Enumeration): 
     181    "Tape speed (m/s)" 
     182 
     183    class Meta(MetaEnumeration): 
     184        db_table = 'tape_speed' 
     185        verbose_name = _("tape speed (m/s)") 
     186 
     187class TapeVendor(Enumeration): 
     188    "Tape vendor" 
     189 
     190    class Meta(MetaEnumeration): 
     191        db_table = 'tape_vendor' 
     192        verbose_name = _("tape vendor") 
     193 
  • telemeta/models/media.py

    r396801e r7ed402e  
    676676        verbose_name_plural = _('fonds related media') 
    677677 
     678 
     679class Format(ModelCore): 
     680    """ Physical format object as proposed by the LAM""" 
     681 
     682    item = ForeignKey(MediaItem, related_name="formats", verbose_name=_('item')) 
     683    original_code = CharField(_('original code'), required=True) 
     684    support_number = CharField(_('support number')) 
     685    status = CharField(_('status')) 
     686    conservation_state = CharField(_('conservation state')) 
     687    comments = TextField(_('comments')) 
     688 
     689    tape_length = WeakForeignKey(TapeLength, related_name="formats", verbose_name = _("tape length (cm)")) 
     690    tape_width  = WeakForeignKey(TapeWidth, related_name="formats", verbose_name = _("tape width (inch)")) 
     691    tape_speed = WeakForeignKey(TapeSpeed, related_name="formats", verbose_name = _("tape speed (m/s)")) 
     692    tape_vendor = WeakForeignKey(TapeVendor, related_name="formats") 
     693    tape_thickness = CharField(_('tape thickness (um)')) 
     694    tape_diameter = CharField(_('tape diameter (mm)')) 
     695    tape_reference = CharField(_('tape reference')) 
     696 
     697    class Meta(MetaCore): 
     698        db_table = 'media_formats' 
     699        verbose_name = _('format') 
     700 
     701    def __unicode__(self): 
     702        return self.original_code 
     703 
     704    @property 
     705    def public_id(self): 
     706        return self.original_code 
     707 
  • telemeta/templates/telemeta/mediaitem_detail.html

    r25d44c7 r7ed402e  
    196196            <dd>{% if item.recorded_from_date %}{{ item.recorded_from_date }}{% endif %}{% if item.recorded_from_date and item.recorded_to_date%} - {% endif %}{% if item.recorded_to_date %}{{ item.recorded_to_date}}{% endif %}</dd> 
    197197 
     198            {% if last_revision %} 
     199            <dt>{% trans "Last modification" %}</dt> 
     200            <dd>{{ last_revision.time }}</dd> 
     201            {% endif %} 
     202             
    198203        </dl> 
    199204        {% endblock general_info %} 
  • telemeta/views/base.py

    rece5ba0 r7ed402e  
    630630        related_media = MediaItemRelated.objects.filter(item=item) 
    631631        check_related_media(related_media) 
     632        last_revision = Revision.objects.filter(element_type='item', element_id=item.id).order_by('-time')[0] 
    632633 
    633634        return render(request, template, 
     
    637638                    'previous' : previous, 'next' : next, 'marker': marker_id, 'playlists' : playlists, 
    638639                    'public_access': public_access, 'width': width, 'height': height, 
    639                     'related_media': related_media, 'mime_type': mime_type, 
     640                    'related_media': related_media, 'mime_type': mime_type, 'last_revision': last_revision, 
    640641                    }) 
    641642 
Note: See TracChangeset for help on using the changeset viewer.