Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to validate model attributes? #35

Open
Morpheu5 opened this issue May 4, 2018 · 3 comments
Open

How to validate model attributes? #35

Morpheu5 opened this issue May 4, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@Morpheu5
Copy link

Morpheu5 commented May 4, 2018

I may be missing this completely, but I don't see a way of validating attributes of Models for things like uniqueness (say, user names or e-mail addresses?) and so on. Is this functionality that is not implemented / will not be implemented, or is this going to come in the future?

I'm happy to do manual validation, but it would be neat to have this supported by the ORM.

@EnriqueL8
Copy link
Contributor

Hey @Morpheu5, unfortunately this functionality hasn't been implemented just yet. But we could definitely be willing to add it! @kilnerm could you have a look if this is a possibility?

@EnriqueL8 EnriqueL8 added the enhancement New feature or request label May 4, 2018
@Morpheu5
Copy link
Author

Morpheu5 commented May 5, 2018

Thanks for the clarification, @EnriqueL8! I'll go ahead and do my own validation for now, but I'll keep watching this space. Count me in at least for a discussion :)

@yo1995
Copy link

yo1995 commented Jun 27, 2019

Similar question. It would be nice if attributes could be added in a model! (Django does that quite well, and blurs the boundary between a table and a model)

Currently my detour is to use raw SQL to set constraints after the createTableSync() is done. E.g., ALTER TABLE "People" ADD CONSTRAINT uc_person_id UNIQUE(person_id);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants