Giter Site home page Giter Site logo

Comments (4)

benoitbryon avatar benoitbryon commented on August 26, 2024

👍
The specification lives at https://docs.djangoproject.com/en/1.6/ref/settings/#template-loaders and the example above is described at https://docs.djangoproject.com/en/1.6/ref/templates/api/#django.template.loaders.cached.Loader

from django-confit.

benoitbryon avatar benoitbryon commented on August 26, 2024

See current implementation at

TEMPLATE_LOADERS = colander.SchemaNode(
colander.Sequence(),
missing=global_settings.TEMPLATE_LOADERS,
default=global_settings.TEMPLATE_LOADERS,
children=[
colander.SchemaNode(colander.String()),
]
)

from django-confit.

benoitbryon avatar benoitbryon commented on August 26, 2024

Perhaps try to use the accept_scalar option for colander.Sequence.

If it does not work, let's check whether having a "String or Sequence" type is easy or hard. Where"String or Sequence" may look like TupleOrNone but may also be configured (something like OneOfTypes(Sequence(...), String(...))?

Else fallback to a more flexible validation, even if it is "weak". I mean, at the moment with django-confit, making a valid schema pass is more important than making an invalid schema fail: the first goal is to support Django's settings. Later, we may setup smarter validators.

from django-confit.

toopy avatar toopy commented on August 26, 2024

accept_scalar does not make the job :/ If I find something better or if I can implement the OneOfTypes way I'll try to make a PR. But List if a temporary good fix.

from django-confit.

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.