django-fastdev icon indicating copy to clipboard operation
django-fastdev copied to clipboard

feat(blocks): callback

Open Mte90 opened this issue 1 year ago • 6 comments

Ref: https://github.com/boxed/django-fastdev/issues/51

So in my investigation I discovered that the issue is because Unfold register a custom node, CaptureNode so it isn't possible to detect what is the real block as it isn't a Django one.

With this code we are adding a new callback so the dev can implement a way to detect those blocks. The readme include the code for Unfold theme as example.

Mte90 avatar Nov 06 '24 11:11 Mte90

I need also to add:

        result.add('breadcrumbs')
        result.add('nav-sidebar')
        result.add('usertools')

In this callback to fix the warnings, as I can see in this case they are just blocks https://github.com/search?q=repo%3Aunfoldadmin%2Fdjango-unfold%20usertools&type=code but I think that they are not loaded always just present if the template it will just calls them.

Mte90 avatar Nov 11 '24 16:11 Mte90

ping

Mte90 avatar Oct 02 '25 08:10 Mte90

I don't really understand the example, or the problem. The linked issue seems like it's talking about two things? One which I pointed out a bug that can be worked around, and then some other issue that was never explained?

boxed avatar Oct 05 '25 09:10 boxed

The bug you mentioned it was fixed, instead for the rest:

If there are templates that are one inside others, there is this issue with that admin theme for Django. As I found that issue only with that theme, I am not sure if it is the case to implement something like my code inside this, so I left the way to implement something in the Django project in case there is that kind of issue. If you try this package with that theme and navigate the admin you see that there is that error report, and it makes usable (infact I stopped using fastdev).

Mte90 avatar Oct 06 '25 09:10 Mte90

Sorry, but I can't understand what you mean. If you have a crash/error please copy paste it here. Your patch makes no sense to me as it is.

boxed avatar Oct 06 '25 09:10 boxed

I don't have anymore an installation with fastdev to show that error...

Mte90 avatar Oct 06 '25 09:10 Mte90