cleaning up order of things
This commit is contained in:
parent
0798a2a34d
commit
625fede7d6
1 changed files with 11 additions and 17 deletions
|
@ -217,7 +217,6 @@ class Property(models.Model):
|
||||||
class Item(models.Model):
|
class Item(models.Model):
|
||||||
person_keys = ('director', 'writer', 'producer', 'editor', 'cinematographer', 'actor', 'character')
|
person_keys = ('director', 'writer', 'producer', 'editor', 'cinematographer', 'actor', 'character')
|
||||||
facet_keys = person_keys + ('country', 'language', 'genre', 'keyword')
|
facet_keys = person_keys + ('country', 'language', 'genre', 'keyword')
|
||||||
|
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
modified = models.DateTimeField(auto_now=True)
|
modified = models.DateTimeField(auto_now=True)
|
||||||
published = models.DateTimeField(default=datetime.now, editable=False)
|
published = models.DateTimeField(default=datetime.now, editable=False)
|
||||||
|
@ -225,9 +224,18 @@ class Item(models.Model):
|
||||||
#only items that have data from files are available,
|
#only items that have data from files are available,
|
||||||
#this is indicated by setting available to True
|
#this is indicated by setting available to True
|
||||||
available = models.BooleanField(default=False, db_index=True)
|
available = models.BooleanField(default=False, db_index=True)
|
||||||
|
|
||||||
itemId = models.CharField(max_length=128, unique=True, blank=True)
|
itemId = models.CharField(max_length=128, unique=True, blank=True)
|
||||||
oxdbId = models.CharField(max_length=42, unique=True, blank=True)
|
oxdbId = models.CharField(max_length=42, unique=True, blank=True)
|
||||||
|
external_data = fields.DictField(default={}, editable=False)
|
||||||
|
data = fields.DictField(default={}, editable=False)
|
||||||
|
json = fields.DictField(default={}, editable=False)
|
||||||
|
poster = models.ImageField(default=None, blank=True, upload_to=lambda m, x: os.path.join(itemid_path(m.itemId), "poster.jpg"))
|
||||||
|
poster_url = models.TextField(blank=True)
|
||||||
|
poster_height = models.IntegerField(default=0)
|
||||||
|
poster_width = models.IntegerField(default=0)
|
||||||
|
poster_frame = models.FloatField(default=-1)
|
||||||
|
#stream related fields
|
||||||
|
stream_aspect = models.FloatField(default=4/3)
|
||||||
|
|
||||||
objects = managers.ItemManager()
|
objects = managers.ItemManager()
|
||||||
|
|
||||||
|
@ -260,26 +268,11 @@ class Item(models.Model):
|
||||||
_reviews[w.title] = r[0]
|
_reviews[w.title] = r[0]
|
||||||
return _reviews
|
return _reviews
|
||||||
|
|
||||||
external_data = fields.DictField(default={}, editable=False)
|
|
||||||
data = fields.DictField(default={}, editable=False)
|
|
||||||
|
|
||||||
json = fields.DictField(default={}, editable=False)
|
|
||||||
|
|
||||||
def updateImdb(self):
|
def updateImdb(self):
|
||||||
if len(self.itemId) == 7:
|
if len(self.itemId) == 7:
|
||||||
self.external_data = ox.web.imdb.Imdb(self.itemId)
|
self.external_data = ox.web.imdb.Imdb(self.itemId)
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
poster = models.ImageField(default=None, blank=True, upload_to=lambda m, x: os.path.join(itemid_path(m.itemId), "poster.jpg"))
|
|
||||||
poster_url = models.TextField(blank=True)
|
|
||||||
poster_height = models.IntegerField(default=0)
|
|
||||||
poster_width = models.IntegerField(default=0)
|
|
||||||
|
|
||||||
poster_frame = models.FloatField(default=-1)
|
|
||||||
|
|
||||||
#stream related fields
|
|
||||||
stream_aspect = models.FloatField(default=4/3)
|
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
year = self.get('year')
|
year = self.get('year')
|
||||||
if year:
|
if year:
|
||||||
|
@ -368,6 +361,7 @@ class Item(models.Model):
|
||||||
'alternative_titles': 'alternative_titles',
|
'alternative_titles': 'alternative_titles',
|
||||||
'connections_json': 'connections',
|
'connections_json': 'connections',
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_poster(self):
|
def get_poster(self):
|
||||||
poster = {}
|
poster = {}
|
||||||
poster['width'] = self.poster_width
|
poster['width'] = self.poster_width
|
||||||
|
|
Loading…
Reference in a new issue