8

I am finishing up a project in PHP with Yii and phing. Even though Yii is the best web framework I've used to date, I prefer writing Python over PHP. So, I've been looking at web2py and have some questions:

  1. Does web2py provide Javascript form validation? Yii has http://www.yiiframework.com/extension/jformvalidate/
  2. Does web2py have a mongo db plugin? Something comparable to http://www.yiiframework.com/extension/yiimongodbsuite/
  3. Can you write console applications using web2py?
  4. Does web2py auto generate SQL from model classes, or can you generate model classes from a SQL schema? I prefer the latter.
  5. What deployment tools are available for Python web apps? Is there anything like phing? Yes, I'm aware I could use ant, Maven, or even phing, but I'd rather use something implemented in Python.
6
  • I'm biased but i'd suggest you also look into django with a mongo db python backend and jQuery. Apr 8, 2011 at 0:50
  • I have worked with Django before. It's an adequate framework, but nowhere near as mature or complete as Yii, Rails, or many other frameworks IMO.
    – Simian
    Apr 8, 2011 at 1:01
  • 1
    so what you really are asking is "is web.py something that makes it look like I did more work instead of just adding on to drupal?" Django leads you in one direction, but simply does the right thing for a server-side framework, leave the actual ui work/choices up to the developer and not enforce anything on the developer. Apr 8, 2011 at 2:21
  • Huh? Drupal was not mentioned, and Yii has nothing to do with Drupal.
    – Simian
    Apr 8, 2011 at 4:22
  • So did you end up doing anything with web2.py? I'm using Yii at the moment and liking it, but, like you, I'd rather work in python.
    – User
    Oct 30, 2012 at 23:27

1 Answer 1

13

Does web2py provide Javascript form validation?

Out of the box web2py does server-side validation, client side js pre-validation of int, double and calendar popup for date/time/datetime. There are jQuery plugins to add more client-side validation. web2py is mostly serverside, not clientside.

Does web2py have a mongo db plugin? Something comparable to ...

Web2py is written in Python and there is a python module to access mongodb. Web2py has a database abstraction layer that supports 10 relational databases and Google Big Tables. DLA support for couchdb and mondogo is in but only partial and experimental. Will be completed in the next couple of months.

Can you write console applications using web2py?

Web2py apps must run in the browser. You can build normal python console and gui apps that use any of the web2py modules, for example its template language and database abstraction layer.

Does web2py auto generate SQL from model classes, or can you generate model classes from a SQL schema? I prefer the latter.

It can partially do the latter for mysql and postgresql but only partially because its goal is the the opposite: have users write no SQL but use the database abstraction layer for creating tables. The DAL is not an ORM, models are not classes. Web2py has more field types than SQL provides (for example a type password, a type upload, etc.). They affect how the content of the field is handled in forms and they cannot be inferred from an SQL schema.

What deployment tools are available for Python web apps? Is there anything like phing?

web2py has a web based IDE with mercurial integration. You can also use any other development tool that works with Python. I do know phing so I do not know how they compare.

You know... it would be easy to just try web2py. :-) Good luck with Yii anyway. I am sure it is great too.

4
  • It sounds like the client side validation is the only notable shortcoming out of the list. As for phing, it's just a watered down version of Ant written in PHP and installable through pear.
    – Simian
    Apr 8, 2011 at 1:10
  • Oh BTW that's deployment tools, not development tools in the original question.
    – Simian
    Apr 8, 2011 at 1:14
  • 2
    I see. web2py does not need much deployment toos because it does not require installation. Work windows and max you just unzip and click. For a typical the procedure is similar but you need to have python installed. We have installation scripts for various circumstances (ubuntu+apache+mod_wsgi+postgresql, nginx+uwsgi, etc.). The web based IDE has a one-click deploy button for the Google App Engine cloud which requires the GAE SDK installed.
    – Massimo
    Apr 8, 2011 at 3:14
  • 2
    Fabric for Python (especially combined with Mercurial for version control) is an excellent deployment tool.
    – keybits
    Apr 8, 2011 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.