Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Latest commit

 

History

History
56 lines (39 loc) · 1.52 KB

Readme.md

File metadata and controls

56 lines (39 loc) · 1.52 KB

Django ticket #32728

Hello, This Project is made to report a suspicious bug to Django.

In the admin page the editable column will dupulicate when that field`s primary key is set to True. if you set the primary key to False the dupulicate will not happen.

Codes

-------------------
Login Account

ID == demo
Password == demo
-------------------
Versions

Python == 3.8.8
Django == 3.2.2
-------------------

# models.py
class Parts(models.Model):
    class Meta:
        verbose_name = 'Part'
        verbose_name_plural = 'Parts'

    part_id = models.UUIDField(verbose_name='PartID', primary_key=True, unique=True, default='Sample00', max_length=40)
    part_name = models.CharField(verbose_name='PartName', unique=False, default=1, max_length=40, blank=True, null=True)

    def __str__(self):
        return self.part_name

# admin.py
from .models import Parts

class PartAdmin(admin.ModelAdmin):
    list_display = ('part_name', 'part_id')
    list_display_links = ('part_name',)
    list_editable = ('part_id',)
    ordering = ('part_name',)


admin.site.register(Parts, PartAdmin)

Screenshot

Primary_key = True

スクリーンショット 2021-05-07 18 54 46

Screenshot

Primary_key = False

スクリーンショット 2021-05-07 19 11 19