Add descriptions to channels, polish admin panel up a bit
This commit is contained in:
parent
97de889b8b
commit
d3da20dc33
@ -5,16 +5,19 @@ from .models import OdyseeChannel, OdyseeRelease, Tag
|
||||
# Register your models here.
|
||||
@admin.register(OdyseeChannel)
|
||||
class OdyseeChannelAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'handle', 'id']
|
||||
search_fields = ['name', 'handle']
|
||||
list_display = ['name', 'handle', 'description', 'id']
|
||||
search_fields = ['name', 'description', 'handle']
|
||||
ordering = ['name']
|
||||
|
||||
@admin.register(OdyseeRelease)
|
||||
class OdyseeReleaseAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'channel', 'url', 'id']
|
||||
search_fields = ['name', 'url']
|
||||
ordering = ['channel', 'name']
|
||||
list_filter = ['channel', 'tags']
|
||||
|
||||
@admin.register(Tag)
|
||||
class TagAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'description', 'id']
|
||||
search_fields = ['name']
|
||||
ordering = ['name']
|
||||
|
19
odyseescraper/migrations/0005_odyseechannel_description.py
Normal file
19
odyseescraper/migrations/0005_odyseechannel_description.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 5.1.5 on 2025-01-24 05:23
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('odyseescraper', '0004_tag_alter_odyseechannel_id_alter_odyseerelease_id_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='odyseechannel',
|
||||
name='description',
|
||||
field=models.TextField(default=''),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
@ -13,6 +13,8 @@ class Tag(models.Model):
|
||||
class OdyseeChannel(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, db_index=True)
|
||||
name = models.CharField(max_length=1024)
|
||||
description = models.TextField()
|
||||
|
||||
handle = models.CharField(max_length=1024)
|
||||
|
||||
def __str__(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user