GithubHelp home page GithubHelp logo

Validate year of release about mystamps HOT 5 CLOSED

php-coder avatar php-coder commented on June 23, 2024
Validate year of release

from mystamps.

Comments (5)

php-coder avatar php-coder commented on June 23, 2024

Because we already have a check for the year in future (see #8) then here we just need to check that the year >= 1840. I suggest to use @Min annotation for that.

from mystamps.

cssru avatar cssru commented on June 23, 2024

Ага, а я думал - на стороне клиента проверку реализовать.

from mystamps.

php-coder avatar php-coder commented on June 23, 2024

Technically it's already "validated" on the client side -- there is a select with options from 1840 to 2016. So, user couldn't choose the year less than 1840. But... this check intended not for ordinary users :)

from mystamps.

cssru avatar cssru commented on June 23, 2024

Year, angry users may want to put your app down, right?

from mystamps.

php-coder avatar php-coder commented on June 23, 2024

:-) No, probably, it can't break the application, but a) I want to be sure that my data satisfies the constraints b) it's a trivial task that could be accomplished by newcomers :)

BTW, if we would use PostgreSQL, for instance, we could add a CHECK() constraint (I don't try it, but looks like we could).

Another idea about protecting the data is: maybe we would write some logic that operates on the series' year and if someone put -1 as the year this logic goes crazy :)

from mystamps.

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.