essensplan/cal/models.py

14 lines
402 B
Python
Raw Normal View History

2018-07-02 06:06:17 +00:00
from django.db import models
from django.urls import reverse
2018-07-25 06:10:26 +00:00
class Event(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
start_time = models.DateTimeField()
end_time = models.DateTimeField()
@property
def get_html_url(self):
url = reverse('cal:event_edit', args=(self.id,))
return f'<a href="{url}"> {self.title} </a>'