Reputation: 4669
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:
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.
I'm new to both Python and Django, so could someone give me advice?
Upvotes: 8
Views: 5688
Reputation: 17606
Django Scheduler has a quite hidden setting (not even reported in official docs) which can do the trick:
SCHEDULER_BASE_CLASSES = {
'Event': ['my_app.models.EventAbstract1', 'my_app.models.EventAbstract2']
'Calendar': [my_app.models.CalendarAbstract']
}
So, you can define your own abstract model and make Calendar extend it.
EDIT
As @Jheasly said in his comment, this feature is now documented.
Upvotes: 2
Reputation: 2015
To achieve option 3, your generic object would have a foreign key linking to an Event
object from that calendar app.
Upvotes: 4