source: telemeta/models/enum.py @ cf7f390

cremcrem2crem3devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecachegenericlamlam2mapsv3mergenlivemultirelease/1.4.4sabiodsearchserverstoragetelecaster
Last change on this file since cf7f390 was cf7f390, checked in by yomguy <yomguy@…>, 3 years ago

fix trans, add enum for number of channels

  • Property mode set to 100644
File size: 6.6 KB
Line 
1# -*- coding: utf-8 -*-
2# Copyright (C) 2007-2010 Samalyse SARL
3
4# This software is a computer program whose purpose is to backup, analyse,
5# transcode and stream any audio content with its metadata over a web frontend.
6
7# This software is governed by the CeCILL  license under French law and
8# abiding by the rules of distribution of free software.  You can  use,
9# modify and/ or redistribute the software under the terms of the CeCILL
10# license as circulated by CEA, CNRS and INRIA at the following URL
11# "http://www.cecill.info".
12
13# As a counterpart to the access to the source code and  rights to copy,
14# modify and redistribute granted by the license, users are provided only
15# with a limited warranty  and the software's author,  the holder of the
16# economic rights,  and the successive licensors  have only  limited
17# liability.
18
19# In this respect, the user's attention is drawn to the risks associated
20# with loading,  using,  modifying and/or developing or reproducing the
21# software by the user in light of its specific status of free software,
22# that may mean  that it is complicated to manipulate,  and  that  also
23# therefore means  that it is reserved for developers  and  experienced
24# professionals having in-depth computer knowledge. Users are therefore
25# encouraged to load and test the software's suitability as regards their
26# requirements in conditions enabling the security of their systems and/or
27# data to be ensured and,  more generally, to use and operate it in the
28# same conditions as regards security.
29
30# The fact that you are presently reading this means that you have had
31# knowledge of the CeCILL license and that you accept its terms.
32#
33# Authors: Olivier Guilyardi <olivier@samalyse.com>
34#          David LIPSZYC <davidlipszyc@gmail.com>
35
36from telemeta.models.core import *
37from django.utils.translation import ugettext_lazy as _
38
39class Enumeration(ModelCore):
40    "Abstract enumerations base class"
41    value = CharField(_('value'), required=True, unique=True)
42
43    def __unicode__(self):
44        return self.value
45
46    class Meta(MetaCore):
47        abstract = True
48
49class MetaEnumeration(MetaCore):
50    ordering = ['value']
51
52class PhysicalFormat(Enumeration):
53    "Collection physical format"
54
55    class Meta(MetaEnumeration):
56        db_table = 'physical_formats'
57        verbose_name = _("archive format")
58
59class PublishingStatus(Enumeration):
60    "Collection publishing status"
61
62    class Meta(MetaEnumeration):
63        db_table = 'publishing_status'
64        verbose_name = _("secondary edition")
65
66class AcquisitionMode(Enumeration):
67    "Mode of acquisition of the collection"
68
69    class Meta(MetaEnumeration):
70        db_table = 'acquisition_modes'
71        verbose_name = _("mode of acquisition")
72
73class MetadataAuthor(Enumeration):
74    "Collection metadata author"
75
76    class Meta(MetaEnumeration):
77        db_table = 'metadata_authors'
78        verbose_name = _("record author")
79
80class MetadataWriter(Enumeration):
81    "Collection metadata writer"
82
83    class Meta(MetaEnumeration):
84        db_table = 'metadata_writers'
85        verbose_name = _("record writer")
86
87class LegalRight(Enumeration):
88    "Collection legal rights"
89
90    class Meta(MetaEnumeration):
91        db_table = 'legal_rights'
92        verbose_name = _("legal rights")
93
94class RecordingContext(Enumeration):
95    "Collection recording context"
96
97    class Meta(MetaEnumeration):
98        db_table = 'recording_contexts'
99        verbose_name = _("recording context")
100
101class AdConversion(Enumeration):
102    "Collection digital to analog conversion status"
103
104    class Meta(MetaEnumeration):
105        db_table = 'ad_conversions'
106        verbose_name = _("A/D conversion")
107
108class VernacularStyle(Enumeration):
109    "Item vernacular style"
110
111    class Meta(MetaEnumeration):
112        db_table = 'vernacular_styles'
113        verbose_name = _("vernacular style")
114
115class GenericStyle(Enumeration):
116    "Item generic style"
117
118    class Meta(MetaEnumeration):
119        db_table = 'generic_styles'
120        verbose_name = _("generic style")
121
122class ContextKeyword(Enumeration):
123    "Keyword"
124
125    class Meta(MetaEnumeration):
126        db_table = 'context_keywords'
127        verbose_name = _("keyword")
128
129class Publisher(Enumeration):
130    "Collection publisher"
131
132    class Meta(MetaEnumeration):
133        db_table = 'publishers'
134        verbose_name = _("publisher / status")
135
136class PublisherCollection(ModelCore):
137    "Collection which belongs to publisher"
138    publisher = ForeignKey('Publisher', related_name="publisher_collections", verbose_name=_('publisher'))
139    value     = CharField(_('value'), required=True)
140
141    def __unicode__(self):
142        return self.value
143
144    class Meta(MetaCore):
145        db_table = 'publisher_collections'
146        ordering = ['value']
147
148class EthnicGroup(Enumeration):
149    "Item ethnic group"
150
151    class Meta(MetaEnumeration):
152        db_table = 'ethnic_groups'
153        verbose_name = _('population / social group')
154
155class EthnicGroupAlias(ModelCore):
156    "Item ethnic group other name"
157    ethnic_group = ForeignKey('EthnicGroup', related_name="aliases", verbose_name=_('population / social group'))
158    value        = CharField(_('name'), required=True)
159
160    class Meta(MetaCore):
161        db_table = 'ethnic_group_aliases'
162        unique_together = (('ethnic_group', 'value'),)
163        ordering = ['ethnic_group__value']
164
165
166# Tape formats
167class TapeWheelDiameter(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
174class TapeLength(Enumeration):
175    "Tape length (cm)"
176
177    class Meta(MetaEnumeration):
178        db_table = 'tape_length'
179        verbose_name = _("tape length (cm)")
180
181class TapeWidth(Enumeration):
182    "Tape width (inch)"
183
184    class Meta(MetaEnumeration):
185        db_table = 'tape_width'
186        verbose_name = _("tape width (inch)")
187
188class TapeSpeed(Enumeration):
189    "Tape speed (m/s)"
190
191    class Meta(MetaEnumeration):
192        db_table = 'tape_speed'
193        verbose_name = _("tape speed (m/s)")
194
195class TapeVendor(Enumeration):
196    "Tape vendor"
197
198    class Meta(MetaEnumeration):
199        db_table = 'tape_vendor'
200        verbose_name = _("tape vendor")
201
202
203# Original
204
205class ChannelNumber(Enumeration):
206    "Channel number"
207
208    class Meta(MetaEnumeration):
209        db_table = 'original_channel_number'
210        verbose_name = _("number of channels")
211
212class OriginalFormat(Enumeration):
213    "Item original format"
214
215    class Meta(MetaEnumeration):
216        db_table = 'original_format'
217        verbose_name = _("original format")
218
219class OriginalLocation(Enumeration):
220    "Item original location"
221
222    class Meta(MetaEnumeration):
223        db_table = 'original_location'
224        verbose_name = _("original location")
Note: See TracBrowser for help on using the repository browser.