> What if I don't want to use models.py? I think it would be better if > you could develop something more in line with Rails' scaffold, but > without the model layer. I think there's a Java framework that works > like that.
Grails, written in Groovy, which is a language that runs on JVM, does scaffolding as well, as you might have guessed from the name :-) > IOW, introspect the database (not foreign keys and everything else), > and then build an admin site dynamically. That would be > self-contained, it wouldn't require you to write the model layer if > you already have a database set up, and it wouldn't require to be > bound to any particular paradigm such as MVC. You could just snap it > onto any existing site. SQLAlchemy has a mode to detect table structures and populate fields of a Python class that you declare. Although you can also fully define your model. I'm not sure about the difference in functionality between the two but the latter is definitely faster. In Grail's case, you declare the models and give some hit in the models about constraints and relationships and mappings. This is very helpful in generating the forms with the tables behind having some 1:1, 1:n or n:n mappings. Plus, writing a model isn't too hard so of an optional model makes the generated CRUD forms more usable, I'd say it's a good idea. I know not everyone is a fan or ORM. I suppose you can borrow some code from SQLAlchemy but this is more work. For an admin app, using an ORM isn't such a bad idea since typically you don't have to touch the code. You'll just point it to the tables and optionally give it some hints and it'll do the work for you. Your other part of the project isn't tied to the ORM. > -- > Branko Vukelić -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
