[Django] #24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html list

17 views
Skip to first unread message

Django

unread,
Apr 4, 2015, 2:29:27 PM4/4/15
to django-...@googlegroups.com
#24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html
list
-------------------------------+--------------------
Reporter: shultais | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
I have 3 Models

1. Category
2. Product with FK on Category
3. Video with FK on Product

When I delete a Category I see
[[Image(http://shultais.ru/media/temp/django18.jpeg)]]

List of items on level 3 is not converted to html (ul, ol) list and
escaped.

--
Ticket URL: <https://code.djangoproject.com/ticket/24582>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 4, 2015, 8:03:29 PM4/4/15
to django-...@googlegroups.com
#24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html
list
-------------------------------+--------------------------------------

Reporter: shultais | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Could you please share your models? I couldn't reproduce this from the
relationships you described. Here is what I tried:
{{{
class Category(models.Model):
name = models.CharField(max_length=100)

class Product(models.Model):
name = models.CharField(max_length=100)
category = models.ForeignKey(Category)

class Video(models.Model):
product = models.ForeignKey(Product)

class Order(models.Model):
product = models.ForeignKey(Product)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24582#comment:1>

Django

unread,
Apr 5, 2015, 5:44:28 AM4/5/15
to django-...@googlegroups.com
#24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html
list
-------------------------------+--------------------------------------

Reporter: shultais | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by shultais):

My models
{{{
# -*- coding: utf-8 -*-
import uuid

from django.db import models
from django.contrib.postgres.fields import ArrayField, HStoreField,
IntegerRangeField
from django.contrib.auth.models import User


class Category(models.Model):
name = models.CharField(max_length=100)

class Meta:
verbose_name = u"category"
verbose_name_plural = u"categories"
ordering = ("name",)

def __unicode__(self):
return self.name


class Product(models.Model):
active = models.BooleanField(default=True)
category = models.ForeignKey(
Category,
default=None,
null=True,
verbose_name=u"category",
)
name = models.CharField(max_length=100)
price = models.DecimalField(decimal_places=0, max_digits=10,
blank=True, default=0)
quantity = models.IntegerField(default=0)

# Для Postgresql
sizes = ArrayField(
base_field=models.IntegerField(),
size=8,
verbose_name=u"Sizes",
blank=True,
null=True,
default=None
)
sizes_full = HStoreField(
u"Sizes and quantity",
blank=True,
null=True,
default=None
)
age = IntegerRangeField(blank=True, null=True, default=None)

class Meta:
verbose_name = u"product"
verbose_name_plural = u"products"

def __unicode__(self):
return self.name

COLORS = [
["", u"---"],
["black", u"black"],
["white", u"white"],
["red", u"red"],
["blue", u"blue"],
["green", u"green"],
["yellow", u"yellow"],
]


class ProductVideo(models.Model):
product = models.ForeignKey(Product)
duration = models.DurationField()
code = models.TextField(u"YouTube code")

class Meta:
verbose_name = u"video"
verbose_name_plural = u"video"

def __unicode__(self):
return u"video %s" % self.id


class Color(models.Model):
product = models.ForeignKey(Product)
color = models.CharField(max_length=10, default="", choices=COLORS)
quantity = models.IntegerField(default=0)

class Meta:
verbose_name = u"color"
verbose_name_plural = u"colors"
unique_together = ("product", "color")

def __unicode__(self):
return u"%s: %s" % (self.product.name, self.get_color_display())


class Order(models.Model):
user = models.ForeignKey(User, verbose_name=u"user")
id = models.UUIDField(primary_key=True, editable=False,
default=uuid.uuid4)
product = models.ForeignKey(Product)
quantity = models.IntegerField(default=1)

class Meta:
verbose_name = u"order"
verbose_name_plural = u"orders"

def __unicode__(self):
return u"Order %s" % self.id

}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24582#comment:2>

Django

unread,
Apr 6, 2015, 1:36:52 PM4/6/15
to django-...@googlegroups.com
#24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html
list
-------------------------------+--------------------------------------

Reporter: shultais | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timgraham):

I couldn't reproduce your screenshot. Attaching a screenshot of what I
see.

--
Ticket URL: <https://code.djangoproject.com/ticket/24582#comment:3>

Django

unread,
Apr 6, 2015, 1:37:18 PM4/6/15
to django-...@googlegroups.com
#24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html
list
-------------------------------+--------------------------------------

Reporter: shultais | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* Attachment "admin-delete-category.png" added.

Django

unread,
Apr 7, 2015, 7:56:50 PM4/7/15
to django-...@googlegroups.com
#24582: ModelAdmin.delete_view(). List of items on level 3 not converted to html
list
-------------------------------+--------------------------------------
Reporter: shultais | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => worksforme


Comment:

Please reopen if you can provide more detailed steps, thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/24582#comment:4>

Reply all
Reply to author
Forward
0 new messages