Andrew Mleczko
Oct 16, 2012
Plone Conference 2012 from RedTurtle's perspective
It's all over. 5 days with fellow Plonistas in Arnhem, Netherlands. How was it? Read our summary. One thing we are pretty sure - it was the best conference ever
This year's conference was organized for the 10th time by the FourDigits team. They did great job - everything went smoothly - no problems with network, free places in the rooms, video streaming. Even the weather was a pleasant surprise. But above all there were 4 things this conference will be remembered for a very long time:
Document Actions
Jun 27, 2012
Earthquake? Plone to the rescue!
To work in Italy you need to be pragmatic. Very pragmatic. That's why when an earthquake hit our region last month we were more than happy to help. Check out what we have done in 72h using Plone, Pyramid and Facebook
The idea behind the project is simple: build a tool that will help suffered companies to sell their products. It should be intuitive and integrates with social networks to gain publicity. You probably heard about the parmigiano reggiano losses and the huge will to buy all the cheese that was left. Our project should help people do it much easier.
Check the site: www.facciamoadesso.it
Plone
Most of the application is done in Plone, which is so fast to develop nowadays. We have used heavily eea.facetednavigation which saved us hours if not days. Big thanks to Alin Voinea, Alexandru Ghica, Antonio De Marinis. You guys rock!
We have implemented a custom facebook integration with a separate PAS plugin. We couldn't use plonesocial.auth.rpx cause we wanted to integrate more deeply with facebook app (more about that later), and that will cost a fortune using rpxnow.com.
We have also added a small disqus trick that notifies archetype object owner that somebody made a comment. We are using the callback method:
function disqus_config() {
this.callbacks.onNewComment = [function(comment) {
$.post('%(document_url)s/disqus_notify', {comment: comment});
}];
}
Document Actions
Oct 31, 2011
Plone at PyCon UA
I spent last weekend (22-23 October) in Kiev promoting Plone and Pyramid at PyCon UA. It was an amazing opportunity to spread the latest news about Plone4 and its enhancements.
The Kiev event was fruitful experience from two points of view: the audience was not aware of what has been happening in Plone since 3.x; they were mostly Django developers. I think I did my best to explain what are the key values of using Plone and Pyramid together and what are the benefits comparing to other frameworks like Django. I met several fantastic guys deeply interested in what we are doing in both Plone and Pyramid community. Hope to see you all on another Python event.
Apart of Plone talk there were other invited speakers. Let me mention few of them.
Opening talk done by Tarek was about Packaging. He explained current situation of packaging in Python and the future of it. I hope we will have setup.cfg to rull-them-all in near future and that the community will start to use proper versioning soon.
Then there was Armin with Basket of Random Python Snippets. I don't like the idea of showing ONLY code while doing your presentation but I strongly encourage you to read them online. Some of them are really great tips!
Last talk I attended was done by Alexander and I must admit - I have enjoyed it a lot. He was showing "SQLAlchemy: a better ORM". I was never a big fun of Django ORM but now I'm strongly convinced that Pyramid + SQLAlchemy + pyramid_formalchemy is a way much easier to play with.
Bottom line: I must agree with Yury that it would be more interesting event if all of the speakers present slides in English (like on RuPy2011 last October). Nevertheless I enjoy this weekend a lot. I love the city and the atmosphere. The topics and invited speakers were properly chosen so everybody could find a subject to discuss about. Thanks again and hopefully see you next year.
And tomorrow it is time for Plone Conference 2011 which will end this autumn's conference marathon.
Document Actions
Oct 20, 2011
RuPy 2011 - Strongly Dynamic Conference
Last weekend (14-16 Oct 2011) I've attended RuPy (Ruby + Python), a strongly dynamic conference held in Poznań (Poland) and organized by GIK Association. I had a great opportunity to share RedTurtle's "Pyramid and Plone" integration use case with wider audience. It was truly an open source event and a great opportunity to meet geeks from the Ruby community.
It was RuPy's 3rd 4th edition and apart it was the biggest (ca. 300 attendees) I must say - it was the best (I was attending all previous editions). The GIK have chosen Poznań International Fairs as the conference venue which was a damn good idea. During 3 days of the conference there was ca. 30 events (talks, workshops and sprints). Most of them was related to Ruby which is a problem each year. Getting more support from Python community is highly appreciated!
What I think is notable is the speaker feedback system. Each room had 3 containers marked: :-) :-| and :-(. After each session the speaker was receiving his anonymous feedback from the audience. From the speaker point of view (so also mine) it's surprisingly easy and gives you great opportunity to check if what you've just said wasn't a completely bullshit. What I would suggest is to make bigger effort in promoting it after each talk.
Interesting talks
my subjective list of notable talks
Programmer Anarchy
by Fred George
Writing your own programming language
by José Valim
Tradeoffs and Choices: Why Ruby Isn't Python
by Yehuda Katz
I didn't find the slides but I hope RuPy team will publish them soon. In the mean time - short abstract:
"When a Pythonista first dives into Ruby, he is confronted with a strange and unusual world. Multiple kinds of functions, implicitness everywhere, violations of the Zen of Python galore! In this talk, Yehuda will talk about the tradeoffs in Ruby's language design: why, in many ways, Ruby couldn't be more like Python even if it wanted to."
Summary
It was an amazing weekend with some interesting discussions with people from Python and Ruby world. Thanks RuPy, hope to see you next year!
Last but not least the organization committee followed best practices and shared their website source code to wide public.
Document Actions
Jun 20, 2011
Pyramid CRUD sprint summary
Pyramid CRUD sprint is over. It was an amazing event thanks to Gaël Pasgrimaud and Patrick Gerken. We have been sprinting in Redturtle's office to improve pyramid_formalchemy and fa.jquery. We have archived most of the sprint goals!
Patrick was working on the first two tasks:
PASTER TEMPLATE
It can be used to add a skeleton to an existing project or to create a new project. If you create a new project, you must first install pyramid_formalchemy in your python environment, either with pip:
$ pip install pyramid_formalchemy
or with easy_install:
$ easy_install pyramid_formalchemy
Only after that, the paster template becomes available. The template was made with the idea that it can be used to extend existing applications. It does not create an app for you. The provided template works well with pyramid_alchemy, pyramid_routesalchemy and akhet. To bootstrap an application, call paster like that:
$ paster create -t akhet -t pyramid_fa myapp
The application is created by akhet, akhet does not know about pyramid_formalchemy, and pyramid_formalchemy cannot modify the app configuration. So you have to do this by hand. First, you must add the install dependency like explained earlier. Second, you must add the following line in the main method that returns the wsgi app, directly after Configurator has been created (The example assumes that the Configurator instance is stored under the name “config”):
... config.include(myapp.fainit) ...
To add the minimum configuration to an existing application, you should be able to run:
$ paster create -t pyramid_fa myapp
All files that paster creates are prefixed with fa, and should not interfere with existing code.
FANSTATIC
Patrick's second task was fanstatic integration. Fanstatic is a small but powerful framework for the automatic publication of resources on a web page. Think Javascript and CSS. It just serves static content, but it does it really well. Integrating it with fa.jquery was a time consuming task but we managed to get a working proof of concept. I will blog more details when we publish something stable.
Next tasks were handled by Gaël:
CUSTOMISABLE ACTIONS
Action are basically links or input button. By default there is only one category buttons which are the forms buttons but you can add some categories like this:
>>> from pyramid_formalchemy.views import ModelView
>>> from pyramid_formalchemy import actions
>>> class MyView(ModelView):
... actions_categories = ('buttons', 'custom_actions')
... defaults_actions = actions.defaults_actions.copy()
... defaults_actions.update(edit_custom_actions=Actions())
Where myactions is an Actions instance
You can also customize the actions per Model:
>>> from sqlalchemy import Column, Integer >>> from sqlalchemy.ext.declarative import declarative_base >>> Base = declarative_base() >>> class MyArticle(Base): ... __tablename__ = 'myarticles' ... edit_buttons = Actions() ... id = Column(Integer, primary_key=True)
The available actions are: listing, new, edit
But you can add your own:
>>> from pyramid_formalchemy.views import ModelView >>> from pyramid_formalchemy import actions >>> class MyView(ModelView): ... actions.action() ... def extra(self): ... # do your stuff ... return self.render(**kw)
I18N
Yes, pyramid_formalchemy is now i18n! You need to add to your pipeline:
[app:pyramid] ... default_locale_name = en available_languages = fr en
and that's it! Right now we have english and french translations but others are coming.
I was working on the first three tasks:
View customization
This was one of the main sprint tasks - to have a possibility to customize CRUD views per model. You can register them simply like that:
config.formalchemy_model_view('admin',
model='pyramidapp.models.Foo',
context='pyramid_formalchemy.resources.ModelListing',
renderer='templates/foolisting.pt',
attr='listing',
request_method='GET',
permission='view')
and per Model:
config.formalchemy_model_view('admin',
model='pyramidapp.models.Foo',
context='pyramid_formalchemy.resources.Model',
name='',
renderer='templates/fooshow.pt',
attr='show',
request_method='GET',
permission='view')
formalchemy_model_view is an extension for config.add_view so you can use all view specific kwargs.
Widgets
We were able to finish simple implementation of autocomplete widget. It's not yet fully documented but it will be released in pyramid_formalchemy 0.4. Here is how you use it:
from pyramid_formalchemy.renderers import pyramid_autocomplete User.group.set(renderer=pyramid_autocomplete(filter_by='name'))
where User is your fieldset and group is your relation field; filter_by parameter is the SQLAlchemy column you want to filter (autocomplete) on.
Events hooks
We have provided four events:
- IBeforeValidateEvent
- IAfterSyncEvent
- IBeforeDeleteEvent
- IBeforeRenderEvent
There are also two more specific render evnts:
- IBeforeShowRenderEvent
- IBeforeEditRenderEvent
You can use pyramid_formalchemy.events.subscriber decorator to use them:
from pyramid_formalchemy import events from pyramidapp.models import Foo @events.subscriber([Foo, events.IBeforeValidateEvent]) def before_foo_validate(context, event): #do your stuff here
Summary
It was a very productive four days. Thanks again for all your help. We should release new versions of pyramid_formalchemy and fa.jquery in the following days. If you don't want to wait - grab the development versions on github.
You can find more sprint photos here - http://www.flickr.com/photos/tags/crudsprint2011



