summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/python/generate_cal_urls.py16
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()