element_type = 'playlist'
public_id = CharField(_('public_id'), required=True)
author = ForeignKey(User, related_name="playlists", db_column="author")
- name = CharField(_('name'), required=True)
+ title = CharField(_('title'), required=True)
description = TextField(_('description'))
is_current = BooleanField(_('current_user_playlist'))
<h3>{% trans "Playlists" %} {% trans "Add" %}</h3>
{% for playlist in playlists %}
<div>
- <h2>{{ playlist.playlist.name }} {% if playlist.playlist.is_current %}(current){% endif %}
+ <h2>{{ playlist.playlist.title }} {% if playlist.playlist.is_current %}(current){% endif %}
<a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id %}">CSV</a>
{% if not playlist.playlist.is_current %}
{% trans "Make_Current" %}
if isinstance(playlist, dict):
m = Playlist()
m.public_id = playlist['public_id']
- m.name = playlist['name']
+ m.title = playlist['title']
m.description = playlist['description']
m.author = request.user
m.is_current = False
def update_playlist(request, playlist):
if isinstance(playlist, dict):
m = Playlist.objects.get(public_id=playlist['public_id'])
- m.name = float(playlist['name'])
+ m.title = float(playlist['title'])
m.description = playlist['description']
m.save()
else:
playlist = Playlist.objects.get(public_id=public_id, author=request.user)
resources = PlaylistResource.objects.filter(playlist=playlist)
response = HttpResponse(mimetype='text/csv')
- response['Content-Disposition'] = 'attachment; filename='+playlist.name+'.csv'
+ response['Content-Disposition'] = 'attachment; filename='+playlist.title+'.csv'
writer = UnicodeWriter(response)
items = []