A collection of opinions, thoughts, tricks and misc. information.
Heh. The framework's getting MUCH easier to use
... And it's still not quite where I want it... Here's a quick little sample, a user registration process. This is the ENTIRE thing. Form validation, generation, database entry,
etc. We've even got a great captcha generator that handles them fairly transparently.
A focus on finishing up unit tests comes tomorrow after work... After that I'll be doing a separation between the server and framework, and then a few touchups and additions to the library and it's ready for the first alpha release... (it might be a while).
from kepty.lib.forms import *
from kepty.lib.scaffolding import validate_input
# Create a form...
username = CharWidget(fv=Validator(min_length=2))
password = PassWidget(fv=Validator(field_match='password_confirm'))
password_confirm = PassWidget()
email = CharWidget(fv=Validator(is_email=True))
birthdate = DateTimeWidget(fv=Validator(max_age=18))
description = TextWidget(fv=Validator(min_length=2))
captcha = CaptchaWidget(fv=Validator(valid_captcha=True))
# Creates a quick template file... We delete this command as soon as it's been run.
def register(request, errored=False, registration=RegisterForm):
if registration == None:
user = kepty.lib.database.ORM.create('users')
return "Thanks! You've been registered, %s!" % user.username
application = kepty.make_app(
kepty.mount('/tester', application, 'tester')