0

I've integrated Django-Scheduler into my project that has a events.py file that creates a "title" in the class "Event". I've added some other variables with Inheritance.For the next Step I need to change Title into a ForeignKey, thats why I've tried this little code:

from django.db import models
from schedule.models import Event

class LessonEvent(Event):

    title = models.ForeignKey(Student, on_delete=models.CASCADE)

Because of the Fact that the original class Event has not Abstract=True in the Meta Django gives me this Error:

lessons.LessonEvent.title: (models.E006) The field 'title' clashes with the field 'title' from model 'schedule.event'

Is there a way to solve this, without touching the code of the django-scheduler app?

Vineeth Sai
  • 3,389
  • 7
  • 23
  • 34
  • Why don't you just change the name of your field to something else? `title_field` perhaps? you aren't touching the Scheduler class don't worry, inheritance is downwards not upwards. – Vineeth Sai Nov 12 '18 at 07:10
  • Shure that will work, but afterwards the calendar shows "title" in the calendarView and I want that this calendar is showing my Foreign Key. It would also be always a required to fill something in the title at the admin section. – Lukas Schönsgibl Nov 12 '18 at 07:35

0 Answers0