Giter Site home page Giter Site logo

Comments (4)

skorokithakis avatar skorokithakis commented on July 22, 2024

Hmm, I see. Any idea why that's happening?

from django-annoying.

georgema1982 avatar georgema1982 commented on July 22, 2024

My guess is that Django Admin use ModelForm in a different way from what we usually do. The mechanism of autostrip decorator is it injects clean methods on CharFields of the form on initialization. But Admin will probably ignore them because it initializes form in a different way. Without digging into the source code, that's just my wild assumption. Actually I change the lambda inside the decorator to a named function so that I can print something. When I create a form instance, it does print what I expect. While in Admin, these print statements are never called.

from django-annoying.

skorokithakis avatar skorokithakis commented on July 22, 2024

Ah, it does sound like the ModelAdmin doesn't call the .clean() method, then. I'll investigate, thanks.

from django-annoying.

georgema1982 avatar georgema1982 commented on July 22, 2024

clean() method is called in ModelAdmin. But I have the feeling that it's not the one injected by the decorator.

from django-annoying.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.