Using Rum to complement Camelot (web and desktop with one model)

9 views
Skip to first unread message

Jeroen Dierckx

unread,
Sep 27, 2011, 7:41:52 AM9/27/11
to rum-discuss, bricke...@mfo.de
Hi all,

I started an email conversation with Michael, but i decided this might
be useful for others too ...
Blame gmail for the top posts.
---
Dear Michael,
Thanks for your opinions!

Can i conclude that you see Flask more as a means to serve as enduser
frontend, co-existing with Rum/Pyramid as an administration backend?


I don't have any experience with Pylons or Pyramid. But at first
sight, Pyramid does not really have an advantage over Flask in context
of my intentions imho. The (traditional) routing mechanism seems
fairly similar. I hadn't seen the Traversal mechanism before, but it
seems a bit outdated and not very flexible ... It could be fast to
develop because it's more compact, but harder to debug and manipulate,
isn't it?

I like the fact that Flask is simple and doesn't get in my way, i
don't consider it *too* simple though. I chose it, because i didn't
mind doing some "ground-work" because my understanding of the system
as a whole would be better. (Keep in mind that i still consider myself
a student of Python and software design concepts in general, i do not
have an academic background).

I probably need to study Pyramid some more, though my time is very
limited so it'll set back development.
Maybe i'll keep on prototyping for a while to learn more about where
this is going and what exactly is needed.

So for the sake of the prototype, do you have routing examples for Rum
that i could try (to convert for use) in Flask?

Any insights and motivations are very welcome! ( eager to learn :) )

Best regards,
Jeroen



On Mon, Sep 26, 2011 at 1:17 PM, Michael Brickenstein wrote:
Hi Jeroen!
Am 24.09.2011 um 14:15 schrieb Jeroen Dierckx:

> Hello Michael,
>
> I finally found some time and started work on a web counterpart to Camelot (http://www.python-camelot.com/). The ultimate goal is to be able to create a desktop app and a webapp in one go,

Hmm, the ultimate goal would be configuring a web application and a
GUI-application simultaneously...
That would be very awesome, but also very hard.
The good thing, that we have very flexible configuration so I can
imagine that we can do that for
common tasks at least.

> i.e. by creating one model set and generating all the admin stuff, sort of like Django, but more flexible.

and using SQLAlchemy, I think that's a major selling point.
>
> I have a prototype of these admin pages, but i decided to try and integrate Rum instead. Hopefully that way i have all the features you guys already made with a minimum of effort.
>
> Currently i am using Flask (http://flask.pocoo.org/) plus some extensions as a basis (request handling and routing stuff).
> Would you advise that i skip Rum and try and integrate Limoncello instead?
No integrating, RUM is just right. It's a WSGI application itself, so
you can use it standalone or embed it in any
WSGI application.
> Do you perhaps have experience with Flask?
No, but isn't it a little bit too simple?

Dispatching such an application is a nontrivial problem.
Actually, Alberto wants to move RUM to Pyramid and I agree that it is
a good plan.
Pyramid really provides the right thing with its Traversal mechanism
and on the other hand provides good and very well documented
possibilities to
extend your application with more views.

>
> PS: if you would like me to post this to a mailing list, as opposed to asking you directly, just let me know.

Usually, it's better to have public communication.
Feel free to post a reply on rum-discuss

Greetings to Antwerp,
Michael

Michael Brickenstein

unread,
Sep 28, 2011, 4:01:02 AM9/28/11
to rum-d...@googlegroups.com, Jeroen Dierckx
Hi Jeroen!

I hope that Alberto can enlighten us with more of his technical knowledge.
But, let's start here and now.

Am 27.09.2011 um 13:41 schrieb Jeroen Dierckx:

> Hi all,
>
> I started an email conversation with Michael, but i decided this might
> be useful for others too ...
> Blame gmail for the top posts.
> ---
> Dear Michael,
> Thanks for your opinions!
>
> Can i conclude that you see Flask more as a means to serve as enduser
> frontend, co-existing with Rum/Pyramid as an administration backend?

Flask/Pyramid/Werkzeug/Pylons/TurboGears/Grok or any WSGI compatible framework can be used
for the end user frontend and they can share their user identification with rum and other small things that matter.
Personally, I mount my rum application in a Pylons application.

>
>
> I don't have any experience with Pylons or Pyramid. But at first
> sight, Pyramid does not really have an advantage over Flask in context
> of my intentions imho. The (traditional) routing mechanism seems
> fairly similar.

Pyramid supports traversal + routes.

Well, from my perspective, I had already trouble enough with
the performance of the routes mechanism from Pylons.
Since you asked for routing example, I have to point you to code
where Alberto wrote:

# XXX: the router is kind of messy, should be cleaned up sometime and
# optimized in the future since it's a very hot path

https://bitbucket.org/albertov/rum/src/79d0d92a30a1/rum/router.py

Look at the resource function.
This is called for every resource/class.
It registers some routes for each.

The implementation follows the guidelines from
https://routes.groovie.org/restful.html

Depending on the complexity of your model, the number of routes can grow
quite much.
For a small application, performance was okay, but for a more complex, I got
5000-10000 routes which were processed almost linearly.

I rewrote the router and now it looks like that:

https://bitbucket.org/albertov/rum/src/45d33dc27542/rum/router.py

I am not to happy with it in terms of clarity, but at least the performance is
okay.
Moreover the number of routes is constant with 64=2^6 which is okay for performance now,

but on the other hand, I have the fear that with more requirements at some time the exponent might increase.

> I hadn't seen the Traversal mechanism before, but it
> seems a bit outdated and not very flexible ... It could be fast to
> develop because it's more compact, but harder to debug and manipulate,
> isn't it?

You might want to have a look at:
http://blip.tv/pycon-us-videos-2009-2010-2011/the-big-f-ing-tutorial-development-using-the-repoze-bfg-web-framework-part-001-2011260

>
> I like the fact that Flask is simple and doesn't get in my way, i
> don't consider it *too* simple though. I chose it, because i didn't
> mind doing some "ground-work" because my understanding of the system
> as a whole would be better.
> (Keep in mind that i still consider myself
> a student of Python and software design concepts in general, i do not
> have an academic background).

>
> I probably need to study Pyramid some more, though my time is very
> limited so it'll set back development.
> Maybe i'll keep on prototyping for a while to learn more about where
> this is going and what exactly is needed.

I like this attitude :-), I would do that myself.

I wish you a nice day and hope that you have also nice weather in Belgium (it's really a nice autumn day here).

Best regards,
Michael


>
> So for the sake of the prototype, do you have routing examples for Rum
> that i could try (to convert for use) in Flask?
>
> Any insights and motivations are very welcome! ( eager to learn :) )
>
> Best regards,
> Jeroen
>
>
>

-------------------------------------------
Dr. rer. nat. Michael Brickenstein
Mathematisches Forschungsinstitut Oberwolfach gGmbH
Schwarzwaldstr. 9 - 11
77709 Oberwolfach
Tel.: 07834/979-31
Fax: 07834/979-38

Reply all
Reply to author
Forward
0 new messages