21 lines
625 B
Python
21 lines
625 B
Python
from django.contrib import admin
|
|
from django.contrib.auth.models import User
|
|
from django.db import models
|
|
|
|
from web.models.base import BaseModel
|
|
from web.models.event import Event
|
|
|
|
|
|
class EventComment(BaseModel):
|
|
id = models.AutoField(primary_key=True)
|
|
event = models.ForeignKey(Event, on_delete=models.CASCADE, related_name='comments')
|
|
content = models.TextField(blank=False, null=False)
|
|
submitted_by = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
|
|
class Meta:
|
|
db_table = 'events_comments'
|
|
|
|
|
|
class EventCommentAdmin(admin.ModelAdmin):
|
|
list_display = ('event', 'content', 'submitted_by')
|