senaite / senaite.databox Goto Github PK
View Code? Open in Web Editor NEWProvides data from a configured catalog search and column configuration
Home Page: https://www.senaite.com
License: GNU General Public License v2.0
Provides data from a configured catalog search and column configuration
Home Page: https://www.senaite.com
License: GNU General Public License v2.0
If user puts date with year value earlier than 1900 year in date_from
and date_to
field:
that causes exception in databox_controls.pt
:
...
Module Products.PageTemplates.engine, line 378, in __call__
Module z3c.pt.pagetemplate, line 176, in render
Module chameleon.zpt.template, line 302, in render
Module chameleon.template, line 215, in render
Module chameleon.template, line 192, in render
Module 2cfdf7d550b9a6fb1f96f131bf2f6928, line 993, in render
Module zope.tales.pythonexpr, line 73, in __call__
- __traceback_info__: (date_to and date_to.strftime('%Y-%m-%d'))
Module <string>, line 1, in <module>
ValueError: year=23 is before 1900; the datetime strftime() methods require year >= 1900
- Expression: "python:date_to and date_to.strftime('%Y-%m-%d')"
- Filename: ... rc/senaite/databox/browser/templates/databox_controls.pt
- Location: (line 164: col 43)
- Source: ... es="value python:date_to and date_to.strftime('%Y-%m-%d')"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Expression: "provider:plone.abovecontentbody"
- Filename: ... te/core/browser/main_template/templates/main_template.pt
- Location: (line 132: col 84)
- Source: ...
...
would you mind if we add year check in the setter method, like this:
...
from senaite.core.api.dtime import to_DT
...
# DATE TO
def _set_date_to(self, value):
self.context.date_to = to_DT(value) if to_DT(value).year() >= 1900 else None
Or there any better options?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.