小编Zah*_*abi的帖子

无法在python 3.7中安装Matplotlib

对于在Windows 10 64位机器上安装matplotlib得到错误显示

python setup.py egg_info" failed with error code 1 in C:\Users\Animus\AppData\Local\Temp\pip-build-urqbuxb_\unroll\
Run Code Online (Sandbox Code Playgroud)

请帮忙

python analysis matplotlib

9
推荐指数
1
解决办法
1万
查看次数

Django 管理员通过标签搜索

如何使用tag在django 管理面板中进行搜索?

它将使用称为django-taggit包的标签进行搜索。

管理员.py

@staticmethod
def get_tags(obj):
       tags = []
       for tag in obj.tags.all():
           tags.append(str(tag))
       return ', '.join(tags)

 list_display = (
        'id'
        'portions',
        'get_tags',
        'created'
    )
    search_fields = ('name', get_tags, 'created', 'id')`
Run Code Online (Sandbox Code Playgroud)

模型.py

from taggit.managers import TaggableManager

tags = TaggableManager(through=TaggedOffer, blank=True)
    name = models.CharField(max_length=255)
    price = models.DecimalField(
        null=True,
        max_digits=10,
        decimal_places=2,
        validators=[positive_decimal]
    )
Run Code Online (Sandbox Code Playgroud)

错误 异常类型:FieldError 异常值:
无法将关键字“get_tags”解析为字段。

python tags django django-admin django-taggit

0
推荐指数
1
解决办法
622
查看次数