# -*- encoding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ class Media(models.Model): media_hash = models.CharField(_('media hash'), max_length = 128, db_index=True) # メディアハッシュ title = models.CharField(_('title'), max_length = 128, blank=True) # タイトル artist = models.CharField(_('artist'), max_length = 128, blank=True) # アーティスト album = models.CharField(_('album'), max_length = 128, blank=True) # アルバム year = models.CharField(_('year'), max_length = 4, blank=True) # 西暦 track = models.IntegerField(_('track'), blank=True) # トラック genre = models.IntegerField(_('genre'), blank=True) # ジャンル file_path = models.CharField(_('file path'), max_length = 128, blank=True) # ファイルパス file_size = models.CharField(_('file size'), max_length = 128, blank=True) # ファイルサイズ time_stamp = models.DateTimeField(_('time stamp'), max_length = 128, blank=True) # 更新日時 youtube_id = models.CharField(_('youtube id'), max_length = 128, blank=True) # YouTube ID # メタ情報 class Meta: app_label = 'django_app' # アプリケーション名 verbose_name = _('Media') # 単数形名称 verbose_name_plural = _('Medias') # 複数形名称 db_table = 'vlc_media' # テーブル名 ordering = ('artist', 'album', 'track',) # ソート列 unique_together = (('media_hash'),) # unique制約