Commit dfc29402 authored by Ciella Francisco's avatar Ciella Francisco 😵

Modified html templates and models to enable URL redirectin for adding and editing events

parent ab78e69f
......@@ -21,6 +21,9 @@ class Event(models.Model):
def get_absolute_url(self):
return reverse('event_management:event-details', kwargs={'pk': self.pk})
def get_update_url(self):
return reverse('event_management:event-update', kwargs={'pk': self.pk})
# def save(self, *args, **kwargs):
# if self.event_datetime_end is None:
......
......@@ -12,4 +12,5 @@
{% for promo in object.promos.all %}
<img src="{{ promo.img.url }}"/>
{% endfor %}
<button type="button" onclick="location.href='{{ event.get_update_url }}'">Update</button>
{% endblock %}
......@@ -13,4 +13,5 @@
</ul>
{% endfor %}
</ul>
<button type="button" onclick="location.href='/events/add/'">Add Event</button>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment