title: Model inheritance approach with Django's ORM
body: <p>I want to store events in a web application I am fooling around with and I feel quite unsure about the pros and cons of each respective approach - using inheritance extensively or in a more modest manner.</p>
  
  <p>Example:</p>
  
  <pre><code>class Event(models.Model):
      moment = models.DateTimeField()
  
  class UserEvent(Event):
      user = models.ForeignKey(User)
      class Meta:
          abstract = True
  
  class UserRegistrationEvent(UserEvent):
      pass # Nothing to add really, the name of the class indicates it's type
  
  class UserCancellationEvent(UserEvent):
      reason = models.CharField()
  </code></pre>
  
  <p>It feels like I'm creating database tables like crazy. It would require alot of joins to select things out and might complicate querying. But it's design feels nice, I think.</p>
  
  <p>Would it be more reasonable to use a "flatter" model that just has more fields?</p>
  
  <pre><code>class Event(models.Model):
      moment = models.DateTimeField()
      user = models.ForeignKey(User, blank=True, null=True)
      type = models.CharField() # 'Registration', 'Cancellation' ...
      reason = models.CharField(blank=True, null=True)
  </code></pre>
  
  <p>Thanks for your comments on this, anyone.</p>
  
  <p>Philip</p>