使用您自己的模型Django调度程序 [英] Using the Django scheduler app with your own models
问题描述
使用 https://github.com/llazzaro/django-scheduler 我会喜欢在日历中使用自己的模型,他们也有一个开始和结束日期。
Using the https://github.com/llazzaro/django-scheduler I'd like to use my own models in the calendar, they also have a start and end date.
我认为有多种方法可以解决这个问题:
I think there are multiple ways to solve this problem:
- 在创建模型时使用save()覆盖创建默认事件模式。
- 使用django-scheduler应用程序的事件关系到通用对象功能。
- 扩展默认事件模式以满足我自己的要求。
- Hack the current schedule app to make it interact with my models.
- Creating default event modals when creating my models, using the save() override.
- Use the "relations of events to generic objects" feature of the django-scheduler app.
- Extend the default event modals to meet my own requirements.
我想使用第三个选项,但是我不知道如何使用它,因为日历链接到单个对象。
I would like to use the third option but I wouldn't know how to use it since a calendar is linked to a single object.
我是新来的python和django,所以有人可以给我建议吗?
I'm new to both python and django, so could someone give me advice?
推荐答案
要实现选项3,您的通用对象将具有链接到该日历应用程序的 Event
对象的外键。
To achieve option 3, your generic object would have a foreign key linking to an Event
object from that calendar app.
这篇关于使用您自己的模型Django调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!