Changeset 3797809


Ignore:
Timestamp:
May 2, 2012 3:34:04 PM (3 years ago)
Author:
yomguy <yomguy@…>
Branches:
security
Children:
b030e30
Parents:
0f7c20f (diff), c8cdfbe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
yomguy <yomguy@…> (02/05/2012 15:34:04)
git-committer:
yomguy <yomguy@…> (02/05/2012 15:34:04)
Message:

Merge branch 'master' into security

Files:
9 added
7 edited

Legend:

Unmodified
Added
Removed
  • telemeta/models/__init__.py

    r44cc478 r2444cce  
    4343from dublincore import * 
    4444from language import * 
     45from format import * 
    4546 
  • telemeta/models/enum.py

    r7ed402e rc8cdfbe  
    163163        ordering = ['ethnic_group__value'] 
    164164 
     165 
    165166# Tape formats 
     167class WheelDiameter(Enumeration): 
     168    "Tape wheel diameter (cm)" 
     169 
     170    class Meta(MetaEnumeration): 
     171        db_table = 'tape_wheel_diameter' 
     172        verbose_name = _("tape wheel diameter (cm)") 
     173 
    166174class TapeLength(Enumeration): 
    167175    "Tape length (cm)" 
     
    192200        verbose_name = _("tape vendor") 
    193201 
     202class OriginalFormat(Enumeration): 
     203    "Item original format" 
     204 
     205    class Meta(MetaEnumeration): 
     206        db_table = 'original_format' 
     207        verbose_name = _("original format") 
     208 
  • telemeta/models/media.py

    rfad4d14 r2444cce  
    5050from telemeta.models.enum import * 
    5151from telemeta.models.language import * 
     52from telemeta.models.format import * 
    5253from django.db import models 
    5354 
     
    347348    track                 = CharField(_('item number')) 
    348349    creator_reference     = CharField(_('reference')) 
     350    original_format       = ForeignKey(Format, related_name="item", 
     351                                       verbose_name=_('orinal format'), blank=True, 
     352                                        null=True, on_delete=models.SET_NULL) 
    349353    external_references   = TextField(_('published references')) 
    350354    copied_from_item      = WeakForeignKey('self', related_name="copies", verbose_name=_('copy of')) 
     
    676680        verbose_name_plural = _('fonds related media') 
    677681 
    678  
    679 class 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     tape_number = CharField(_('tape 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/views/base.py

    re12b60a8 r2444cce  
    257257        year_min, year_max = MediaCollection.objects.all().publishing_year_range() 
    258258        pub_years = year_min and year_max and range(year_min, year_max + 1) or [] 
    259         searches = Search.objects.filter(username=request.user) 
     259        if request.user.is_authenticated(): 
     260            searches = Search.objects.filter(username=request.user) 
     261        else: 
     262            searches = [] 
    260263        return render(request, 'telemeta/search_criteria.html', { 
    261264            'rec_years': rec_years, 
     
    427430    @method_decorator(login_required) 
    428431    def users(self, request): 
    429         users = User.objects.all() 
     432        users = User.objects.all().order_by('last_name') 
    430433        return render(request, 'telemeta/users.html', {'users': users}) 
    431434 
     
    654657            last_revision = None 
    655658 
    656         physical_format = Format.objects.filter(item=item) 
    657         if physical_format: 
    658             physical_format = physical_format[0] 
     659        physical_format = item.format.physical_format 
    659660 
    660661        return render(request, template, 
  • telemeta/admin.py

    rbfa68c2 rf83d820  
    66from telemeta.models.system import * 
    77from django.contrib import admin 
     8<<<<<<< HEAD 
     9from django.forms import CheckboxSelectMultiple 
     10======= 
     11>>>>>>> master 
    812from django.contrib.auth.models import User 
    913from django.contrib.auth.admin import UserAdmin 
  • telemeta/models/system.py

    rfad4d14 r0f7c20f  
    4242import django.db.models as models 
    4343from django.forms import ModelForm 
     44from django.contrib.sessions.models import Session 
    4445 
    4546 
     
    9091    telephone       = CharField(_('Telephone')) 
    9192    expiration_date = DateField(_('Expiration_date')) 
     93    last_session_key = CharField(blank=True, null=True, max_length=40) 
    9294 
    9395    class Meta(MetaCore): 
  • telemeta/templates/telemeta/inc/collection_related.html

    r28fa06b r5a09eb7  
    7878                                 {% endif %} 
    7979                                {% endif %} 
    80                                 {% endif %} 
     80                              {% endif %} 
    8181                            </td> 
    8282                        </tr> 
Note: See TracChangeset for help on using the changeset viewer.