Mixonomer/rename_playlist.py

15 lines
415 B
Python
Raw Normal View History

2020-04-30 14:54:05 +01:00
from music.model.user import User
from music.model.playlist import Playlist
2020-04-30 14:54:05 +01:00
user = User.collection.filter('username', '==', 'andy').get()
name = input('enter playlist name: ')
2020-04-30 14:54:05 +01:00
playlist = Playlist.collection.parent(user.key).filter('name', '==', name).get()
if playlist is not None:
new_name = input('enter new name: ')
2020-04-30 14:54:05 +01:00
playlist.name = new_name
playlist.update()
else:
print('playlist not found')