chat functional

This commit is contained in:
2023-12-15 20:32:43 +01:00
parent 7e2c29e78b
commit bcb072f7d9
16 changed files with 456 additions and 51 deletions

View File

@ -1,6 +1,7 @@
from django.db import models
from django.db.models import IntegerField
from django.contrib.auth.models import User
from django.contrib import admin
# Create your models here.
class ChannelModel(models.Model):
@ -10,8 +11,14 @@ class MemberModel(models.Model):
member_id = IntegerField(primary_key=False)
channel_id = IntegerField(primary_key=False)
def __str__(self):
return "member_id: " + str(self.member_id) + ", channel_id: " + str(self.channel_id)
class MessageModel(models.Model):
channel_id = IntegerField(primary_key=False)
author_id = IntegerField(primary_key=False)
content = models.CharField(max_length=255)
time = models.DateField()
time = IntegerField(primary_key=False)
def __str__(self):
return "author_id: " + str(self.author_id) + ", channel_id: " + str(self.channel_id) + ", content: " + self.content