Hacker News new | ask | show | jobs
by VWWHFSfQ 1594 days ago
Looks cool but it seems like it might still need some work?

I tried it on one of my Django `admin.py` files and it created NameErrors.

    class TestAdmin(admin.ModelAdmin):
      list_filter = ("foo_method",)

      def foo_method(self, obj):
        return "something"

      foo_method.short_description = "Foo method"

    # It turned it into this:

    class TestAdmin(admin.ModelAdmin):
      list_filter = ("foo_method",)

      # NameError
      foo_method.short_description = "Foo method"

      def foo_method(self, obj):
        return "something"
1 comments

Yup, that's a bug. All assignments are treated as properties and moved to the top. Fix to follow shortly.
Have pushed fix as version 0.10.0. Thank you very much for reporting.
Cool no problem! I'll keep an eye on this project