First Commit
This commit is contained in:
commit
ce0758fbbb
496 changed files with 52062 additions and 0 deletions
0
tchat/__init__.py
Executable file
0
tchat/__init__.py
Executable file
3
tchat/admin.py
Executable file
3
tchat/admin.py
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
tchat/apps.py
Executable file
6
tchat/apps.py
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class TchatConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "tchat"
|
||||
33
tchat/migrations/0001_initial.py
Executable file
33
tchat/migrations/0001_initial.py
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 4.2.16 on 2024-10-22 11:02
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Chat",
|
||||
fields=[
|
||||
("id", models.AutoField(primary_key=True, serialize=False)),
|
||||
("content", models.CharField(max_length=100)),
|
||||
("created", models.DateTimeField(auto_now_add=True)),
|
||||
("active", models.BooleanField(default=True)),
|
||||
(
|
||||
"author",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
tchat/migrations/__init__.py
Executable file
0
tchat/migrations/__init__.py
Executable file
12
tchat/models.py
Executable file
12
tchat/models.py
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
from django.db import models
|
||||
from users.models import User
|
||||
|
||||
class Chat(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
content = models.CharField(max_length=100)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
return f'Chat({self.id}, {self.author}, {self.content}, {self.created})'
|
||||
3
tchat/tests.py
Executable file
3
tchat/tests.py
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
tchat/views.py
Executable file
3
tchat/views.py
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Loading…
Add table
Add a link
Reference in a new issue