OH-SHOWN / ohshown-backend

OH!SHOWN 野生動物出沒痕跡通報系統
http://ohshown.site
MIT License
2 stars 8 forks source link

refactor api:admin:document.py #77

Open tai271828 opened 2 years ago

tai271828 commented 2 years ago

Describe the solution you'd like We have moved the model from factory to ohshown_event. We should update document model accordingly.

For example, in this code block:

    @set_function_attributes(short_description="工廠號碼")
    def factory_display_number(self, obj):
        return mark_safe(
            '<a href="{}">{}</a>'.format(
                reverse("admin:api_factory_change", args=(obj.factory.id,)),
                obj.factory.display_number,
            )
        )

The reverse url should be admin:api_ohshownevent_change.

We have to refactor this model otherwise we could not use the document system in the django admin console.