Changeset 8fdcce4


Ignore:
Timestamp:
Jan 31, 2011 10:37:26 AM (4 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, prob, production, release/1.4.4, sabiod, search, security, server, social, storage, telecaster, test, video
Children:
d4c2dd3, 467ce1f
Parents:
f95dd85
git-author:
yomguy <yomguy@…> (31/01/2011 10:37:26)
git-committer:
yomguy <yomguy@…> (31/01/2011 10:37:26)
Message:

fix mimetype analyzer (telemeta side), fix csrf for login, (re)add TEMPLATE_CONTEXT_PROCESSORS to settings

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • INSTALL

    r88eba7a r8fdcce4  
    115115 
    116116    ADMINS =            telemeta requires that you indicate an administrator here 
    117     DATABASE_* =        your database settings (don't forget to create the database if needed) 
     117    DATABASES =         your database setting dict (don't forget to create the database if needed) 
    118118    MEDIA_ROOT =        absolute path to the media directory you just created 
    119119    INSTALLED_APPS =    add 'telemeta' to the tuple 
    120120     
    121121Add the following variables: 
     122     
     123    TEMPLATE_CONTEXT_PROCESSORS = ( 
     124        'django.core.context_processors.request', 
     125        'django.core.context_processors.auth',) 
    122126 
    123127    TELEMETA_ORGANIZATION =  name of the organization which hosts this installation 
  • telemeta/admin.py

    r3d49f41 r8fdcce4  
    11from telemeta.models.media import MediaCollection, MediaItem 
     2from telemeta.models.system import User 
    23from django.contrib import admin 
    34 
    45admin.site.register(MediaCollection) 
    56admin.site.register(MediaItem) 
     7admin.site.register(User) 
    68 
  • telemeta/templates/telemeta_default/login.html

    r6c66d075 r8fdcce4  
    99{% endif %} 
    1010 
    11 <form class="login" method="post" action="{% url telemeta-login %}"> 
     11<form class="login" method="post" action="{% url telemeta-login %}">{% csrf_token %} 
    1212<p> 
    1313{{ form.username.label_tag }} 
  • telemeta/web/base.py

    rd281e63 r8fdcce4  
    4848from django.contrib import auth 
    4949from django.contrib.auth.decorators import login_required 
     50from django.core.context_processors import csrf 
    5051 
    5152from telemeta.models import MediaItem, Location, MediaCollection, EthnicGroup 
     
    145146                decoder  = timeside.decoder.FileDecoder(item.file.path) 
    146147                pipe = decoder 
    147                 mime_type = decoder.mimetype 
    148148                 
    149149                for analyzer in self.analyzers: 
     
    154154                pipe.run() 
    155155                 
     156                mime_type = decoder.format() 
     157                analyzers.append({'name': 'Mime type', 'id': 'mime_type', 'unit': '', 'value': mime_type}) 
     158                     
    156159                for analyzer in analyzers_sub: 
    157160                    value = analyzer.result() 
     
    161164                        item.save() 
    162165                        value = datetime.timedelta(0,value) 
    163                     if analyzer.id() == 'mime_type': 
    164                         value = decoder.format() 
    165166                         
    166167                    analyzers.append({'name':analyzer.name(), 
     
    168169                                      'unit':analyzer.unit(), 
    169170                                      'value':str(value)}) 
    170                  
     171                   
    171172            self.cache.write_analyzer_xml(analyzers, analyze_file) 
    172173             
Note: See TracChangeset for help on using the changeset viewer.