After attending the Pycon 2010 Forms panel (video link)and reading Ian’s latest post on the subject. I figured I should write my thoughts on this to see if someone agrees with me and maybe I can finally release some code that implements this.
The main problem here is that All frameworks (including ian’s anti-framework) are focused on solving the “forms” problem and they totally sidetrack having “display widgets” and more advanced controls.
Take for example Twitter.com after you login at http://twitter.com/ all you see is a ton of links and a couple of buttons, if you look closer there is one form and it’s very tailored to that specific post which is something none of the “form frameworks” allow because their hole goal is to shield you from the complexity of the html/CSS and JS code by coding the form in python. And as Ian puts it you have to dive deep into the framework to figure out where and how to replace that template.
Now the missing part of the and again I’ll use twitter as an example http://twitter.com/followers it’s all buttons! there is not a single form in there yet they are all widgets I’m pretty sure the internal code to render each one of the people following you it’s a widget and the drop down controls are probably widgets too.
If you take a look at other popular sites like facebook, digg, reddit, tumblr, etc. they all follow this pattern of display widgets with ajax callbacks to the backend. And this is where I think all current widgets/forms libraries fail. None of them have this type of setup and the few that do (Sprox & FormAlchemy to my knowledge) end up having to make the problem several degrees more complex than what it should.
And this is why I think we need a totally new tool for Widgets, one that is not trying to solve (once more) the Forms problem but focuses on solving the display and interaction problem.
This tool should have the following components
- handle render and validation client-side and leaving the server-side to the framework
- handle rendering “display widgets” for each object type, that is if you have a Comment object, they should all render the same way.
- Injection of resources, like ToscaWidgets where rendering the widget will inject it’s CSS and JS files, this is actually just a fix because html and JS lack a proper import directive.
- Handle callbacks and errors.
The problem I see with this library is that implementing it in python means making it obscure by hiding the details, while implementing it in JS will tie it to a single framework.
Thoughts and Comments appreciated
I think I just found the “killer feature” of google buzz, and I’m going to enjoy it.
Notice a couple of things from that pic.
- It was originally a tweet
- It has the conversation in one page (as opposed to twitter
- It is linking the following people an ex-coworker and good friend, a current coworker, someone from my university and someone I know from open source
- we are on topic, something specific
- I was able to reply to everyone in one blip(?) how you call them in buzz?
So how this compares to other engines?
- it has the same conversation flow
- But due to it’s closed nature I am not broadcasting
- My personal rule of facebook is that I need to know you in person to get you
- It has this pesky “registration” where we need to agree to be “friends”.
- It lacks the real time engine
- It lacks the conversation view, some clients have it but it’s a hack rather than a feature, for those interested you basically need to walk the tree from the bottom up essentially making it very hard to build the full tree unless you have all the leafs.
- Twitter netiquette implies you don’t spam your followers with things they don’t really care about so long conversations then to piss everyone not involved off
- You get to keep all your conversations
- You don’t get the 100’s of > which makes long conversations hard to follow
- You don’t have to remember to hit reply all
- Don’t need to choose a priori who is interested in your input.
All in all I’m really enjoying this. I think It’s a keeper.
Lets start by building an image.
$ toppcloud create-node —image-id 14362 —size-id 1 maetico.com
Creating node (image=Ubuntu 9.10 (karmic); size=256 server)
Status BUILD at IP 173.203.203.228
The hostname/ip is not setup in /etc/hosts
Would you like me to set it up? [y/n] y
Executing sudo python /home/elpargo/venvs/toppcloud/src/toppcloud-mongodb/toppcloud/update_etc_hosts.py /etc/hosts 173.203.203.228 maetico.com
So what is all that happen there? well toppcloud used libcloud to go to rackspace and create a node, using ubuntu 9.10 and the small 256MB image, it also added a nice shortcut so your machine will resolve properly even if DNS is not set yet.
Note: it will ask your for your provider and API key in your first run to create toppcloud.conf which is not shown up there.
Now we run:
toppcloud setup-node maetico.com
This will basically install toppcloud into the machine, in short it will setup your ssh key, Apache, mod_wsgi, Varnish, etc. everything you came here for. So it transform that vanilla ubuntu into a toppcloud machine.
Please note that setup-node is supposed to be non-distructive so previous installs can be upgraded. If it fails then it’s a bug.
Next
toppcloud default-node maetico.com
That’s to make all commands will go to that node, very handy.
Next to create a layout
toppcloud init ~/venvs/maetico.com
then we’ll create a index.html and drop it in the static folder.
and set default_host in your app.ini
[production]
app_name = maetico.com
version = 1
## Uncomment these to make them available:
#service.postgis =
#service.files =
#service.couchdb =
#service.mongodb =
runner = <insert your runner here>
## Uncomment to have /url called each time the app is updated:
# update_fetch = /url
## If you always upload this app to a particular hostname, use this:
default_host = maetico.com
Then we go for deploy
toppcloud update ~/venvs/maetico.com/
Note: you must end your path with / otherwise update will work but toppcloud will fail to find your app.ini
and if you go to the URL it’s up and running!
so what next? just make a change and run
toppcloud update ~/venvs/maetico.com/
change and update and change and update and again, super fast, super easy.
now for a real python app. go edit your app.ini and set the path to a WSGI file (it is relative to the basedir of app.ini)
make it something simple say:
from webob.dec import wsgify
from webob import Request
@wsgify
def application(req):
return “pronto aca…!”
update again and there python goodness!
Minor Notes:
Old deployments stay in the server and after a while they make add up cruft that is why we have
toppcloud query
toppcloud clean-node
query will show all old stuff as “defunt” and clean-node will get rid of it.
Also check out toppcloud serve this will give you a local server with code reload so you don’t have to waste those precious seconds waiting for the dev box to deploy.
PS: stay tunned for my new home page, it will replace that URL soon :)
PS2: next will be how to deploy a TurboGears app.
Today @Meleniemela tweeted about this thing I downloaded it and just fell in love.
First it shows you unread tweet count per lists. And it clearly shows with a background color which you read and which you haven’t.
Landscape dsplay!
Awesome preview of @ replies (it load the original tweet right below the current one) so you barely have to open the “conversation” window.
It autoload by scrolling either up or down.
Inline loading of images is also great.
Some minor quirks.
In landspace mode the button to go back is a bit small.
I can’t reorder lists (or can’t figure out how)
The photo button is in the way, I always click it not sure why.
What’s up with jailbroken push isn’t that pre OS3.0 ?
Anyway awesome app go try it out http://bit.ly/4UMf65
Recently I have been getting more and more into tweetdeck. And I have discover a couple of features that are off the default which you may like.
1- twitter name autocomplete: When you type @ a popup will show you the full list of people you follow. (Preferences -> General)
2- Auto include hash tags: this is very handy for replying to people, to maintain the conversation for people watching the hashtag. You can also edit them so no big deal. (Preferences -> General)
3- Mark Updates as Read when moving with the keyboard: this one is awesome because you can read faster and then just click “Clean seen updates” (Preferences -> General)
4- open profiles in webpage: IMO this makes things faster as the AIR client is super slow for loading those, not sure why… (Preferences -> General)
5- Max. number of updates per API call , set it to 200 this way very busy columns will not cut off (Preferences -> Twitter)
6- Max. number of updates in column, set it to 1000 this way you can let the tweet pile up for some time and catch up later, very good for when you are busy and can’t see the tweets, the default of 200 is too little specially for “trending searches” (Preferences -> Twitter)
7- enable facebook account, hey at least you will read it from here.
Another thing I really like is to have the Mentions and Direct Messages as my first two columns this way you can reply faster, perhaps I should do a post on how to organize your columns
So I’m testing tumblr and it’s twitter integration.
My goal is to post longer than 140 tweets here as well as some articles if I get inspired now that I don’t have to maintain the server for the blog.
So I’m feed up with wordpress given the my old blog is at http://blog.maetico.com/ and I barely post there because I hate to update it and tinyMCE sucks (sadly it seems I have the same crap here).
The real reason is that I have been posting pretty much everything lately at @elpargo but I’m getting the urge to write lately so I guess I’ll give tumblr.com a try.
So cheers to my first post.