Modeling recurring events in a calendar app

I am building a calendar app with recurring events. I taken the basic design from here and modifying it per my needs.

Django Swingtime

I am trying to emulate the functionality of google calendar (which I use personally everyday). One of the features that a user my change the title description and other fields of a particular Occurrence of an Event. The Occurrence still remains connected to the main Event.

My programming skills are not very advanced and so my approach is quite simple.

Here are the basic two models (I have not included the functions)

class Event(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    owner = models.ForeignKey(User, on_delete=models.CASCADE)
	...
class Occurrence(models.Model):
    
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    title = models.CharField(max_length=100)
    description = models.TextField(null=True, blank=True)
    category = models.CharField(max_length=30)
    start_time = models.DateTimeField()
    end_time = models.DateTimeField()
    timezone = models.CharField(max_length=100, choices=TIMEZONE_CHOICES)
    event = models.ForeignKey(Event, verbose_name="event occurrence", editable=False, on_delete=models.CASCADE)

Now I can modify an occurrence easily since each has its own data.

  • Do you think this is an acceptable approach?
  • Can this be used in a real-world application?