sqldesigner again

28 views
Skip to first unread message

mdipierro

unread,
Oct 16, 2008, 4:14:45 PM10/16/08
to web2py Web Framework
I am working on T3 (something on top of T2) and it is cool and I would
like to use SQLDesigner.

Does anybody have a simple web2py app that packages the latest
SQLDesigner and saved/loads the model server side in XML?

I am not looking for something that creates a web2py schema and I need
something that has no options about exporting at all. It should load
from the server, by default, always the same model and only one button
to save serverside in XML.

Anybody?

Massimo

Boris Manojlovic

unread,
Oct 16, 2008, 5:08:36 PM10/16/08
to web...@googlegroups.com
steki:~$ cat routes.py
routes_in=(
('/backend/.*/(?P<file>.*)','/init/default/backend\g<file>'),
('/designer.html','/init/static/designer/index.html'),
('/images/(?P<file>.*)','/init/static/designer/images/\g<file>'),
('/db/(?P<file>.*)','/init/static/designer/db/\g<file>'),
('/js/(?P<file>.*)','/init/static/designer/js/\g<file>'),
('/locale/(?P<file>.*)','/init/static/designer/locale/\g<file>'),
('/styles/(?P<file>.*)','/init/static/designer/styles/\g<file>'),
('/doc/','/init/static/designer/doc/index.html'),
)
routes_out=()



steki:~$ cd models; cat 0.py
db.define_table("data",
      SQLField("tblname", "string"),
      SQLField("created", "datetime", notnull=True, default=datetime.datetime.now()),
      SQLField("tbldata", "blob", notnull=True, default=None))




steki:~$ cd controllers; cat default.py
def index():
    redirect('designer.html')

def backend():
    return dict(request.SOMETHING)




steki:~$ cat ../static/designer/js/config.js
var CONFIG = {
        AVAILABLE_DBS:["mysql","sqlite","web2py","mssql"],
        DEFAULT_DB:"web2py",

        AVAILABLE_LOCALES:["en","fr","de","cs","pl","pt_BR","es"],
        DEFAULT_LOCALE:"en",

        AVAILABLE_BACKENDS:["php-mysql","php-blank","php-file","php-sqlite","web2py-db"],
        DEFAULT_BACKEND:["web2py-db"],

        RELATION_THICKNESS:2,
        RELATION_SPACING:15
}


problem with code above is that i can't really catch post vars (i do not know how?)
as there is only raw post performed by javascript... with no param names or stuff like that.

so if you can tell me how to capture raw POST data i'll finish my code from above :)
If you just need functionality of creating tables for web2py than it should work as it is (no saving :( )
http://steki-host.appspot.com/ (will change url in some moment to more meaning full
--
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."-Albert Einstein

mdipierro

unread,
Oct 16, 2008, 5:27:16 PM10/16/08
to web2py Web Framework
I think your problem is that the JS only submits war posts. no
variables. You can find the raw post data in

request.body.read()

I do not what to generate web2py code because I am building something
that works on GAE. This means I want an abstract representation of the
tables (for example in XML or JSON), I want to store that in the
datastore and convert it into web2py tables dynamically. I am
thinking of a VB like interface running on GAE.

Massimo

On Oct 16, 4:08 pm, "Boris Manojlovic" <boris.manojlo...@gmail.com>
wrote:
> *
> problem with code above is that i can't really catch post vars (i do not
> know how?)
> as there is only raw post performed by javascript... with no param names or
> stuff like that.*
> so if you can tell me how to capture raw POST data i'll finish my code from
> above :)
> If you just need functionality of creating tables for web2py than it should
> work as it is (no saving :( )
> *http://steki-host.appspot.com/*(will change url in some moment to more

Boris Manojlovic

unread,
Oct 18, 2008, 1:56:35 PM10/18/08
to web...@googlegroups.com
here u go... (it is already working as appengine app at  http://designer.bojanka.net/
examples:

(or if you would like to put it on your google hosted account use steki-host as application ID)

source code can be downloaded from http://bojanka.net/w2p-massimo.tar.gz ,
or attached to this message if google allows "big" messages on google groups
This is still work in progress as i'm trying to create project that will allow anyone to use this as a service - look at web2pydesigner example project :)

Boris
w2p-massimo.tar.gz

yarko

unread,
Oct 18, 2008, 6:24:44 PM10/18/08
to web2py Web Framework
Thanks Boris -

I can't wait to look at this some more!

Just a note:

In your controllers/default.py, you should use URL, so that this will
work from app names other than "init" - this worked for me:

def index():
# redirect('designer.html')
redirect(URL(r=request,c='static',f='designer/index.html'))

I have not run through the backend part of this yes, but it will be
interesting to have this called from the admin interface for any
application.

Regards,
Yarko

On Oct 18, 12:56 pm, "Boris Manojlovic" <boris.manojlo...@gmail.com>
wrote:
> here u go... (it is already working as appengine app athttp://designer.bojanka.net/
> examples:http://designer.bojanka.net/designer.html?keyword=defaulthttp://designer.bojanka.net/designer.html?keyword=web2pydesigner
> > AVAILABLE_BACKENDS:["php-mysql","php-blank","php-file","php-sqlite","web2py -db"],
> > >         DEFAULT_BACKEND:["web2py-db"],
>
> > >         RELATION_THICKNESS:2,
> > >         RELATION_SPACING:15
>
> > > }
>
> > > *
> > > problem with code above is that i can't really catch post vars (i do not
> > > know how?)
> > > as there is only raw post performed by javascript... with no param names
> > or
> > > stuff like that.*
> > > so if you can tell me how to capture raw POST data i'll finish my code
> > from
> > > above :)
> > > If you just need functionality of creating tables for web2py than it
> > should
> > > work as it is (no saving :( )
> > > *http://steki-host.appspot.com/*(will<http://steki-host.appspot.com/*%28will>change url in some moment to more
> > > meaning full
>
> > > On Thu, Oct 16, 2008 at 10:14 PM, mdipierro <mdipie...@cs.depaul.edu>
> > wrote:
>
> > > > I am working on T3 (something on top of T2) and it is cool and I would
> > > > like to use SQLDesigner.
>
> > > > Does anybody have a simple web2py app that packages the latest
> > > > SQLDesigner and saved/loads the model server side in XML?
>
> > > > I am not looking for something that creates a web2py schema and I need
> > > > something that has no options about exporting at all. It should load
> > > > from the server, by default, always the same model and only one button
> > > > to save serverside in XML.
>
> > > > Anybody?
>
> > > > Massimo
>
> > > --
> > > "Only two things are infinite, the universe and human stupidity, and I'm
> > not
> > > sure about the former."-Albert Einstein
>
> --
> "Only two things are infinite, the universe and human stupidity, and I'm not
> sure about the former."-Albert Einstein
>
>  w2p-massimo.tar.gz
> 2823KViewDownload

mdipierro

unread,
Oct 18, 2008, 6:34:19 PM10/18/08
to web2py Web Framework
Thank you Boris! this is great. I am not on my computer. I will
download this later today.

Massimo

On Oct 18, 5:24 pm, yarko <yark...@gmail.com> wrote:
> Thanks Boris -
>
> I can't wait to look at this some more!
>
> Just a note:
>
> In your controllers/default.py,  you should use URL, so that this will
> work from app names other than "init" - this worked for me:
>
>   def index():
>       # redirect('designer.html')
>       redirect(URL(r=request,c='static',f='designer/index.html'))
>
> I have not run through the backend part of this yes, but it will be
> interesting to have this called from the admin interface for any
> application.
>
> Regards,
> Yarko
>
> On Oct 18, 12:56 pm, "Boris Manojlovic" <boris.manojlo...@gmail.com>
> wrote:
>
> > here u go... (it is already working as appengine app athttp://designer.bojanka.net/
> > examples:http://designer.bojanka.net/designer.html?keyword=defaulthttp://desig...

Steve Shepherd

unread,
Oct 19, 2008, 6:56:13 PM10/19/08
to web...@googlegroups.com
Boris

THIS is FANTASTIC...did you do all this yourself?
This will leap web2py into the frameworks that beat RoR into submission for us python fans.

IMPORTANT: The only question I have is will it support supersets and subset type definitions.
I will give it a try.


Massimo@ PLEASE make this the designer of choice on your homepage.

Steve

Boris Manojlovic

unread,
Oct 19, 2008, 7:38:36 PM10/19/08
to web...@googlegroups.com
Hi Steve,

no, only things that i have been working on are XSLT  transformation of xml generated with "www sql designer" - that nice gui you see :)
and second thing is wrapping it into web2py as application that is NOT perfect as it rely on routes.py but is functional enough.
I didn't wanted to change code that is wrote by Ondřej Žára - creator of WWW SQL Designer  except config.js so any future update would
be rm -rf web2py/applications/<designer_app>/static/designer and re-creating it from zip file (and changing config.js of course as it is supposed to be performed)

Boris

mdipierro

unread,
Oct 19, 2008, 9:09:49 PM10/19/08
to web2py Web Framework
Hi Boris,

I only seem to be able to create integer fields. Am I doing something
wrong?

Massimo

On Oct 19, 6:38 pm, "Boris Manojlovic" <boris.manojlo...@gmail.com>
wrote:
> Hi Steve,
>
> no, only things that i have been working on are XSLT transformation of xml
> generated with "www sql designer" - that nice gui you see :)
> and second thing is wrapping it into web2py as application that is NOT
> perfect as it rely on routes.py but is functional enough.
> I didn't wanted to change code that is wrote by Ondřej Žára - creator of
> WWW SQL Designer <http://ondras.zarovi.cz/sql/> except config.js so any

yarko

unread,
Oct 20, 2008, 12:10:47 AM10/20/08
to web2py Web Framework
I tried to create a couple of linked tables as well - out of the
string integers I tried to create, only one was declared as string in
the web2py generated snippet; also the constraint required a lot of
hand editing as it was malformed...

Anyway, the concept is good - needs some more testing / feedback.

yarko

unread,
Oct 20, 2008, 12:27:58 AM10/20/08
to web2py Web Framework
that was a slip! I meant to say: "...out of the string fields I
tried to create"

Aspersieman

unread,
Oct 20, 2008, 5:07:34 AM10/20/08
to web...@googlegroups.com
Hey

This is awesome.

However I think there is room for improvement : when you navigate to
http://designer.bojanka.net/ using opera it crashes completely.

I used:
*Version 9.60
*Build 10447
*Platform Win32
*System Windows XP

Regards

Nicol

--
Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

>> *http://steki-host.appspot.com/*(will<http://steki-host.appspot.com/*%28will>change

Steve Shepherd

unread,
Oct 20, 2008, 6:31:37 AM10/20/08
to web...@googlegroups.com
humf to Buffalo - Niagara Rulez LOL

On Mon, Oct 20, 2008 at 10:07 PM, Aspersieman <asper...@gmail.com> wrote:

Hey

This is awesome.

However I think there is room for improvement : when you navigate to
http://designer.bojanka.net/ using opera it crashes completely.

I used:
       *Version 9.60
       *Build 10447mf

yarko

unread,
Oct 20, 2008, 10:56:01 AM10/20/08
to web2py Web Framework
Nicol -

Could you check if the live demo on http://ondras.zarovi.cz/sql works
for you (that's the base code)?

I just installed Opera 9.6 on my WinXPSP2 and both of these links seem
to work ok (I just created & exported some tables from bojanka.net).

Regards,
Yarko

On Oct 20, 5:31 am, "Steve Shepherd" <sargs...@gmail.com> wrote:
> humf to Buffalo - Niagara Rulez LOL
>
> On Mon, Oct 20, 2008 at 10:07 PM, Aspersieman <aspersie...@gmail.com> wrote:
>
> > Hey
>
> > This is awesome.
>
> > However I think there is room for improvement : when you navigate to
> >http://designer.bojanka.net/using opera it crashes completely.
>
> > I used:
> >        *Version 9.60
> >        *Build 10447mf
> >        *Platform Win32
> >        *System Windows XP
>
> > Regards
>
> > Nicol
>
> > --
> > Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo
>
> > On Sat, 18 Oct 2008 19:56:35 +0200, Boris Manojlovic
> > <boris.manojlo...@gmail.com> wrote:
>
> > > here u go... (it is already working as appengine app at
> > >http://designer.bojanka.net/
> > > examples:
> > >http://designer.bojanka.net/designer.html?keyword=default
> > >http://designer.bojanka.net/designer.html?keyword=web2pydesigner
>
> > > (or if you would like to put it on your google hosted account use
> > > steki-host
> > > as application ID)
>
> > > source code can be downloaded fromhttp://bojanka.net/w2p-massimo.tar.gz
> > > ,
> > > or attached to this message if google allows "big" messages on google
> > > groups
> > > This is still work in progress as i'm trying to create project that will
> > > allow anyone to use this as a service - look at web2pydesigner example
> > > project :)
>
> > > Boris
>
> > > On Thu, Oct 16, 2008 at 11:27 PM, mdipierro <mdipie...@cs.depaul.edu>

Aspersieman

unread,
Oct 20, 2008, 3:15:20 PM10/20/08
to web...@googlegroups.com
Yarko

I tried again and got the same effect ("Opera has encountered an error and
must shut down..." - the standard popup when something crashes on windows.)

However - I think this might be a problem with something on *my* pc
specifically. I had a colleague visit the page (using his pc: XP SP2 and
tried both Opera 9.52 and 9.60) and he didn't encounter the problem. So it
*must* be something on *my* pc...

*sigh* This is going to be one of those 'fun' bugfinding expiditions... :)
I'll let everyone know if I find the culprit.

Regards

Nicol

--
Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

yarko

unread,
Oct 20, 2008, 3:58:15 PM10/20/08
to web2py Web Framework
Nicol -

Thanks for the update....

Yarko

A little from my world about Buffalo:
http://yarkos.blogspot.com/2008/08/oh-give-me-home-where-buffalo-roam.html

On Oct 20, 2:15 pm, Aspersieman <aspersie...@gmail.com> wrote:
> Yarko
>
> I tried again and got the same effect ("Opera has encountered an error and  
> must shut down..." - the standard popup when something crashes on windows.)
>
> However - I think this might be a problem with something on *my* pc  
> specifically. I had a colleague visit the page (using his pc: XP SP2 and  
> tried both Opera 9.52 and 9.60) and he didn't encounter the problem. So it  
> *must* be something on *my* pc...
>
> *sigh* This is going to be one of those 'fun' bugfinding expiditions... :)  
> I'll let everyone know if I find the culprit.
>
> Regards
>
> Nicol
>
> --
> Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo
>
> On Mon, 20 Oct 2008 16:56:01 +0200, yarko <yark...@gmail.com> wrote:
>
> > Nicol -
>
> > Could you check if the live demo onhttp://ondras.zarovi.cz/sqlworks
> > for you (that's the base code)?
>
> > I just installed Opera 9.6 on my WinXPSP2 and both of these links seem
> > to work ok (I just created & exported some tables from bojanka.net).
>
> > Regards,
> > Yarko
>
> > On Oct 20, 5:31 am, "Steve Shepherd" <sargs...@gmail.com> wrote:
> >> humf to Buffalo - Niagara Rulez LOL
>
> >> On Mon, Oct 20, 2008 at 10:07 PM, Aspersieman <aspersie...@gmail.com>  
> >> wrote:
>
> >> > Hey
>
> >> > This is awesome.
>
> >> > However I think there is room for improvement : when you navigate to
> >> >http://designer.bojanka.net/usingopera it crashes completely.
> >> AVAILABLE_BACKENDS:["php-mysql","php-blank","php-file","php-sqlite","web2py -db"],

Boris Manojlovic

unread,
Oct 22, 2008, 10:35:50 AM10/22/08
to web...@googlegroups.com
Hi Massimo,

I'm bit confused, just tried it under firefox 3 and ie 7 and it generates same code from examples that i put on
can you try generate web2py schema from web2pydesigner example

Sorry for slow answer but i'm not currently in country and i'm not having network at room only at lobby :(




2008/10/20 mdipierro <mdip...@cs.depaul.edu>

mdipierro

unread,
Oct 22, 2008, 11:31:47 AM10/22/08
to web2py Web Framework
You are correct! I had tried camino and does not let me change the
values of selectboxes. I now tried with firefox and it works. Thank
you!.

Massimo

On Oct 22, 9:35 am, "Boris Manojlovic" <boris.manojlo...@gmail.com>
wrote:
> Hi Massimo,
>
> I'm bit confused, just tried it under firefox 3 and ie 7 and it generates
> same code from examples that i put on
> can you try generate web2py schema from web2pydesigner example
>
> Sorry for slow answer but i'm not currently in country and i'm not having
> network at room only at lobby :(
>
> 2008/10/20 mdipierro <mdipie...@cs.depaul.edu>
Reply all
Reply to author
Forward
0 new messages