Giter VIP home page Giter VIP logo

Comments (8)

pauleveritt avatar pauleveritt commented on May 13, 2024

@samuelcolvin Are the clean_ methods implemented in any way? I don't see "clean" in the source anywhere.

Here's the use case: I want to have an img_url or an img_src, but not both. If both, or neither, are supplied, I want to raise an exception. Will that fit what you have in mind for the clean methods?

from pydantic.

samuelcolvin avatar samuelcolvin commented on May 13, 2024

Currently implemented via validate_* but not documented properly as I mean to change it completely.

from pydantic.

pauleveritt avatar pauleveritt commented on May 13, 2024

Is the usage I described a valid use case for what you intend to do?

from pydantic.

pauleveritt avatar pauleveritt commented on May 13, 2024

Actually if you're going to change it then I'll avoid bugging you about it. No sense making you write stuff down, I can wait.

from pydantic.

samuelcolvin avatar samuelcolvin commented on May 13, 2024

That's exactly the kind of use case.

from pydantic.

samuelcolvin avatar samuelcolvin commented on May 13, 2024

This should be fixed by version v0.6.

@pauleveritt documentation should now be available on validators, see here.

from pydantic.

pauleveritt avatar pauleveritt commented on May 13, 2024

@samuelcolvin Thanks for working on this, and perfect timing, I'm in an overhaul. FWIW, I'm working on a system to put structured YAML data in Sphinx docs, validated by pydantic.

from pydantic.

pauleveritt avatar pauleveritt commented on May 13, 2024

@samuelcolvin As an FYI, I'm using pydantic in an extensible system atop Sphinx. You register classes with models and can then embed schema-validated YAML in documents: https://github.com/pauleveritt/kaybee/blob/master/docs/features.rst#yaml-models

from pydantic.

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.