ft_transcendence/chat/models.py

25 lines
799 B
Python
Raw Permalink Normal View History

2023-11-27 17:31:31 -05:00
from django.db import models
2023-12-12 04:05:13 -05:00
from django.db.models import IntegerField
from django.contrib.auth.models import User
2023-12-15 14:32:43 -05:00
from django.contrib import admin
2023-11-27 17:31:31 -05:00
# Create your models here.
2023-12-12 04:05:13 -05:00
class ChannelModel(models.Model):
pass
class MemberModel(models.Model):
member_id = IntegerField(primary_key=False)
channel_id = IntegerField(primary_key=False)
2023-12-15 14:32:43 -05:00
def __str__(self):
return "member_id: " + str(self.member_id) + ", channel_id: " + str(self.channel_id)
2023-12-12 04:05:13 -05:00
class MessageModel(models.Model):
channel_id = IntegerField(primary_key=False)
author_id = IntegerField(primary_key=False)
content = models.CharField(max_length=255)
2023-12-15 14:32:43 -05:00
time = IntegerField(primary_key=False)
def __str__(self):
2023-12-15 14:32:43 -05:00
return "author_id: " + str(self.author_id) + ", channel_id: " + str(self.channel_id) + ", content: " + self.content