mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Step two (broken)
This commit is contained in:
@@ -2,10 +2,10 @@ from django.contrib import admin
|
||||
from django.utils.html import format_html
|
||||
from adminsortable2.admin import SortableAdminMixin
|
||||
|
||||
from repository.models import DecoderDocument
|
||||
from metadata.models import (
|
||||
Property,
|
||||
Decoder,
|
||||
DecoderDocument,
|
||||
Scale,
|
||||
Shop,
|
||||
Manufacturer,
|
||||
|
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.1.4 on 2025-02-09 13:47
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("metadata", "0023_shop"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="genericdocument",
|
||||
name="tags",
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="DecoderDocument",
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="GenericDocument",
|
||||
),
|
||||
]
|
@@ -6,9 +6,6 @@ from django.dispatch.dispatcher import receiver
|
||||
from django.core.exceptions import ValidationError
|
||||
from django_countries.fields import CountryField
|
||||
|
||||
from tinymce import models as tinymce
|
||||
|
||||
from ram.models import Document
|
||||
from ram.utils import DeduplicatedStorage, get_image_preview, slugify
|
||||
from ram.managers import PublicManager
|
||||
|
||||
@@ -132,20 +129,6 @@ class Decoder(models.Model):
|
||||
image_thumbnail.short_description = "Preview"
|
||||
|
||||
|
||||
class DecoderDocument(Document):
|
||||
decoder = models.ForeignKey(
|
||||
Decoder, on_delete=models.CASCADE, related_name="document"
|
||||
)
|
||||
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["decoder", "file"],
|
||||
name="unique_decoder_file"
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def calculate_ratio(ratio):
|
||||
try:
|
||||
num, den = ratio.split(":")
|
||||
@@ -239,14 +222,6 @@ class Tag(models.Model):
|
||||
)
|
||||
|
||||
|
||||
class GenericDocument(Document):
|
||||
notes = tinymce.HTMLField(blank=True)
|
||||
tags = models.ManyToManyField(Tag, blank=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = "Generic Documents"
|
||||
|
||||
|
||||
class Shop(models.Model):
|
||||
name = models.CharField(max_length=128, unique=True)
|
||||
country = CountryField(blank=True)
|
||||
|
Reference in New Issue
Block a user