update discordchannel model
This commit is contained in:
parent
da8ed90686
commit
6127233c0f
@ -62,7 +62,9 @@ class MessageStyleAdmin(admin.ModelAdmin):
|
|||||||
class DiscordChannelAdmin(admin.ModelAdmin):
|
class DiscordChannelAdmin(admin.ModelAdmin):
|
||||||
list_display = [
|
list_display = [
|
||||||
"id",
|
"id",
|
||||||
"channel_id"
|
"server",
|
||||||
|
"name",
|
||||||
|
"is_nsfw"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
20
apps/home/migrations/0007_discordchannel_server.py
Normal file
20
apps/home/migrations/0007_discordchannel_server.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 5.0.4 on 2024-10-02 20:01
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('home', '0006_remove_discordchannel_name_messagestyle_auto_created'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='server',
|
||||||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.server'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
19
apps/home/migrations/0008_discordchannel_name.py
Normal file
19
apps/home/migrations/0008_discordchannel_name.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 5.0.4 on 2024-10-02 20:53
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('home', '0007_discordchannel_server'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(default='placeholder name', max_length=128),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
@ -0,0 +1,32 @@
|
|||||||
|
# Generated by Django 5.0.4 on 2024-10-02 21:04
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('home', '0008_discordchannel_name'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='channel_id',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='name',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='is_nsfw',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='id',
|
||||||
|
field=models.PositiveIntegerField(primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
|
]
|
19
apps/home/migrations/0010_discordchannel_name.py
Normal file
19
apps/home/migrations/0010_discordchannel_name.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 5.0.4 on 2024-10-02 21:05
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('home', '0009_remove_discordchannel_channel_id_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='discordchannel',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(default='placeholder', max_length=128),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
@ -203,11 +203,13 @@ class DiscordChannel(models.Model):
|
|||||||
is handled internally, when Subscriptions are modified.
|
is handled internally, when Subscriptions are modified.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
id = models.AutoField(primary_key=True)
|
id = models.PositiveIntegerField(primary_key=True)
|
||||||
channel_id = models.BigIntegerField()
|
server = models.ForeignKey(to=Server, on_delete=models.CASCADE, blank=False)
|
||||||
|
name = models.CharField(max_length=128)
|
||||||
|
is_nsfw = models.BooleanField()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.channel_id)
|
return f"#{self.name}"
|
||||||
|
|
||||||
|
|
||||||
# region Subscription
|
# region Subscription
|
||||||
|
Loading…
x
Reference in New Issue
Block a user