diff options
author | emkael <emkael@tlen.pl> | 2016-05-03 22:10:39 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-04 10:05:37 +0200 |
commit | bb11fd7a0d1f24ac145523a84cb3123b2e0ab57f (patch) | |
tree | bd01f009dec9afd82c39dca7dc3b6b27423bde0a /app | |
parent | 0c6e3ee216b30acfca4e3b0fab0b085b8e34960b (diff) |
* generating URLs for calendars
Diffstat (limited to 'app')
-rw-r--r-- | app/python/generate_cal_urls.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/python/generate_cal_urls.py b/app/python/generate_cal_urls.py new file mode 100644 index 0000000..4546b5c --- /dev/null +++ b/app/python/generate_cal_urls.py @@ -0,0 +1,16 @@ +from slugify import slugify + +from rcal.db import Session +from rcal.model import Calendar + +def main(): + session = Session.create() + for calendar in session.query(Calendar).all(): + calendar.custom_url = slugify( + calendar.custom_name + if calendar.custom_name + else calendar.name) + session.commit() + +if __name__ == '__main__': + main() |