api_api/update poster width/height

This commit is contained in:
j 2010-09-06 22:31:12 +02:00
parent c9c597b378
commit 32375a9ff9
2 changed files with 15 additions and 0 deletions

View file

@ -161,6 +161,10 @@ class Movie(models.Model):
if not self.oxdbId: if not self.oxdbId:
self.oxdbId = self.oxid() self.oxdbId = self.oxid()
if self.poster:
self.poster_height = self.poster.height
self.poster_width = self.poster.width
super(Movie, self).save(*args, **kwargs) super(Movie, self).save(*args, **kwargs)
self.updateFind() self.updateFind()
self.updateSort() self.updateSort()

View file

@ -60,6 +60,17 @@ def api(request):
response['Access-Control-Allow-Origin'] = '*' response['Access-Control-Allow-Origin'] = '*'
return response return response
def api_api(request):
'''
returns list of all known api action
return {'status': {'code': int, 'text': string},
'data': {actions: ['api', 'hello', ...]}}
'''
actions = globals().keys()
actions = map(lambda a: a[4:], filter(lambda a: a.startswith('api_'), actions))
actions.sort()
return render_to_json_response(json_response({'actions': actions}))
def api_hello(request): def api_hello(request):
''' '''
return {'status': {'code': int, 'text': string}, return {'status': {'code': int, 'text': string},