Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3311642
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:54:03+00:00 2026-05-17T21:54:03+00:00

I am evaluating some web application frameworks out there, and finally, two of the

  • 0

I am evaluating some web application frameworks out there, and finally, two of the biggest contenders (in my opinion) are Ruby on Rails and Pylons. In order to have a better understanding of the two frameworks without spending too much time, I decided to follow a non-trivial application tutorial on one framework, and try to repeat the same thing on the other. I am hoping that the exercise will highlight the obvious differences.

For my experiment, I’ve chosen Ruby on Rails Tutorial. I’ve finished the application in Rails, and now, I’ve started doing it in Pylons. I’ve reached chapter 6 without too much drama (given that it is mostly static pages up until that point, this is not surprising). Now, I need to implement the model for users, and add the validation logic into the model. The first part is straightforward, but I am stuck on the second part.

From what I see, Pylons takes the approach of implementing validation on the form level. Doing some research, I’ve seen a lot of people suggest that the point where you accept the form input is the right location for input validation. I’ve also gone through quite a number of pylons projects on github, and I haven’t been able to find a single project that handles model level data validation. The closest I’ve seen was where developers stored their forms alongside the data in the model layer, but it is cheating in my opinion. I wouldn’t mind not following the tutorial to the letter and following the crowd, but I happen to agree with the tutorial. For the model in question, the validations are done in the right place: checking password length, user name length, and validating that the e-mail is actually an e-mail all feel to be model level constraints. In addition, if I will have at least two forms that will add data to this model (creating a new user, and modifying information), and repeating the same validation in two different forms doesn’t sound right.

To make a long story short (highlighted for TLDR): is there an infrastructure that I can use that ties the forms to the models a bit more tightly than the suggested SQLAlchemy/formencode pair? With these two, the best I can do is add assertions at the model layer. Actually, that is not true I could try to bridge the gap with custom code, but it does look like an awful lot of code, and quite hard to get right. So, I thought it would be better to ask around before trying to extend code that I don’t really understand.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:54:04+00:00Added an answer on May 17, 2026 at 9:54 pm

    So first, I don’t know of any built in way. Validation at the form level makes sense because different forms/views might access the same model and need to perform different validation based on the current user, the situation (time based), etc. So I’m one of those that’s doing validation as part of the controller level of things.

    Now as to your point on it being a lot of code, I think you could easily create the formencode scheme as part of your SqlAlchemy (SA) models and then just hook into the SA events for object save() and run the validation schema in there. Or write a wrapper function you use to populate the initial object before performing the save. So rather than:

    person = Session.Query(People).get(10)
    person.fname = request.params['fname']
    person.lname = request.params['lname']
    

    You’d do something more like:

    person = Session.Query(People).get(10)
    person.populate(request.params)
    

    and it would iterate through the params and columns in the object to set it, doing validation along the way.

    Sorry that there’s not what you’re looking for, but hope this helps you find a decent middle ground.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's collect some tips for evaluating the appropriate use of global.asax.
I'm evaluating Visual Studio productivity addons for my development team, which includes some folks
I'm evaluating Terracotta to help me scale up an application which is currently RAM-bounded.
I had to develop some custom ASP.NET web controls because I couldn't find ones
I'm currently evaluating the MSF for CMMI process template under TFS for use on
I'm evaluating and looking at using CherryPy for a project that's basically a JavaScript
We are currently evaluating different applications that interface with Visual Studio 2008 (C#) and
I'm currently evaluating CodeRush and one thing that I liked most when reading the
I've recently begun evaluating a few project management projects for the company I work
I am evaluating VintaSoft .net control and Atalasoft DotTwain Image Capture. And I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.