DBSprockets is back, Baby!

So I have had a pretty long hiatus from working on dbsprockets, but I’m back… with a vengeance.  So, I worked hard to get Rum working in TG2, but struggled my ass off and got nowhere.  Left tangled in a web of peak-rules that I did not want to decipher, I began to think about dbsprockets again.  I mean, were we really that far off from what RUM is offering?

The answer turned out to be no.  All I needed to do was to replace the dbsprockets primitives with a class structure.  This turned out to be about an 8 hour job.  Not bad for a day’s work.  And now you can do things like:

from dbsprockets.declaratives import FormBase
from myWebapp.model import User
...
class RegistrationForm(FormBase):
    __model__ = User
    __limit_fields__ = 'user_name', 'email_address', 'display_name', 'password', 'verify'
    __required_fields__ = 'user_name', 'email_address', 'display_name', 'password', 'verify'
    email_address = TextField
    verify = PasswordField('verify')
    __base_validator__ =  Schema(chained_validators=(FieldsMatch('password',
                                                        'verify',
                                                        messages={'invalidNoMatch':
                                                                  "Passwords do not match"}),))
registration_form = RegistrationForm()
class ATurboGearsController(BaseController):
    @validate(form=registration_form.__widget__)
    @expose('genshi:sproxtest.templates.register')
    def register(self, **kw):
        pylons.c.widget = registration_form
        return dict(value={})

This turns out to be a much simpler way of handling forms, because now you can subclass to your heart’s content (for instance, make one base user form which you subclass for admin, registration, profile and login), or even come up with your own wacky WidgetSelector that chooses widgets for you and subclass as you desire. Here is initial documentation, which I will express in more detail at a later date when I have more time to do it the right way.

The simple fact is that you can customize form widgets with ease, limit fields to a set of fields, drop a few fields, basically anything you can think of to change how the database schema actually displays on the page.  The same is true of field validators.  Simply define an attribute of the class that has a validator, widget instance, or widget type, and dbsprockets will do the right thing.  If you want to override both the field and the validator, all you must do is create a widget wit the validator attribute populated.  The greatest thing is that your forms (and tables!) will change with you as your database schema migrates.

Right now I am keeping the primitives way of getting the values from the provider to populate the tables/forms.   This is likely to change in the future.  The primitive way of doing forms is now deprecated.  I will be adding deprecation warnings to the code.  Hooray!

Look for ajax support in the near future on both the view and data side of things.  I have a clear understanding of ExtJS (2.0.1), JSON, and LGPL now and I am not affraid to use it.  In the mean time, a dev version of dbsprockets 0.5 is up at pypi.

12 Responses to “DBSprockets is back, Baby!”

  1. Jorge Vargas says:

    Great news indeed I’m looking forward for it.

  2. Prescription Aciphex…

    So I have had a pretty long hiatus from working on dbsprockets but I’m back… with a veng [...]…

  3. Good morning! That is a lot interesting text. See my private website. I think that’s too interesting.

  4. Thanks for discussing your ideas. I would also like to express that video games have been at any time evolving. Today’s technology and enhancements have made it simpler to create practical and fun games. These entertainment games were not as sensible when the actual concept was being attempted. Just like other kinds of technological know-how, video games too have had to develop through many ages. This is testimony towards the fast growth of video games.

  5. This a little bit funny. I found your site via search engine a few moment ago, and luckily, this is the only information I was looking for the last hours. It will add some followers to your account.

  6. Whoa, this exactly is such an ideal online site. I can hardly restrain my desire of studying every single thing. Thank you for providing so much.

  7. datingsite says:

    You developed some decent points there. I looked more than the internet for any difficulty and located most individuals goes as properly as with your internet internet site.

  8. That is the correct weblog for anybody who needs to search out out about this topic. You understand a lot its virtually exhausting to argue with you (not that I really would need…HaHa). You positively put a new spin on a subject thats been written about for years. Great stuff, just nice!

  9. I am always invstigating online for tips that can assist me. Thx!

  10. I have been absent for a while, but now I remember why I used to love this site. Thanks, I will try and check back more often. How often do you update your blog?

  11. tho xay nha says:

    Wow! Thank you! I continually wanted to write on my blog something like that. Can I implement a fragment of your post to my website?

  12. sjrsxwxbh says:

    Promptly just after understanding around the most correct approach to confirm my suspicion, I purchased an exit indicator undetectable photographic camera. It can become a disguised electronic camera outfitted that has a digital movie recording recorder which will report motion pictures http://www.chaneloutletbagswebsite.com to an provided SD card with out needing further hardware to commonly be set up. You won’t detect the digicam largely mainly because it can be concealed in an frequent “exit” indication..
    Dr. Isbell commenced a healthcare exercise, and Olive opened a college with about two dozen pupils. This quantity before long grew to about fifty, with every college student having to pay 6 bucks for just a phrase of a few months. Around the contrary, these anti-fungal medications do develop uncomfortable side effects, this sort of as, liver damage and nausea, when useful for extended stretch of time. An additional tinea versicolor treatment solution may be the application of dandruff shampoos. They could not be as successful as anti-fungal medicines, but are best for curing minimal infection.
    For the Hermes,Polo Ron Lauren Tee shirt created all over Portugal, died in Paris by utilizing martyr through One hundred twenty Louis Vuitton Mens Wallets, is unquestionably venerated for your http://www.chaneloutletbagswebsite.com louis vuitton canada e jointly aided by the Roman Catholic Non secular and for that reason the Significantly east Orthodox Community centre. The only real rationality why replica tailor made clutches are costly can be the exclusivity involved. Nonetheless, chanel purses could carrying out you would like to get a peek staying along with you..
    Should you be intending to make your ex jealous, scrap it with your checklist. It really is one of the worst measures that you will take. It will just make your condition worst. Soon turn out to be a favorite with your purse assortment. What makes the Sac Mary Kate as an extraordinary bag? In the other side, the bag is narrower with the best that is definitely comfy to carry and display a large profile. A sizable pocket adorns the front and rear, with snap closure for easy storage of individual things of minimal benefits.
    Gucci typically does the appropriate point within the right time. Look at the brilliant brown coloration with the G Wave Tote. It is actually prefer to declaration of your bag to provide you heat feelings in this particular harsh winter season. Whether or not you’re not as energetic as Jessica Simpson, it is possible to also just take two designer handbags gros easily. Will not be so discouraged, petite Rachel Bilson has established a glorious example for yourself. Also at LAX airport, she rocked quirky gray slacks, a person unfamiliar tweed oversized designer leather messenger handbags along with the other Louis Vuitton Monogram Antheia oversized hobo.

Leave a Reply