As the AbstractEvent model is ready, we can create a model for Workshop using that model.
In the event/models.py
file add the following Model :
class Workshop(AbstractEvent):
workshop_title = models.CharField(max_length=255)
venue = models.TextField(null=True, blank=True)
So here, the model is created and the migrations can be applied.
python manage.py makemigrations
python manage.py migrate
And now, the workshop table is created successfully in the database.
You can register this model in the event/admin.py
and view it in the admin page.
from django.contrib import admin
from .models import Workshop
admin.site.register(Workshop)
All the fields of the AbstractEvent will also be accessible here as the Workshop Model inherits from it.
Further we would customize the admin page for Workshop model, to make it more easy to add and edit the details.