Re: [web2py] Re: Web2py Application Exhibition -- Winners!

2010-08-07 Thread Jason Brower
I would have submitted a project of my own had a known.  Sorry that I
missed it.
Next time I hope to compete. Money or not. :D
BR,
Jason Brower

On Fri, 2010-08-06 at 23:38 -0700, Jason Lotz wrote: 
> Kind of a shame only two apps entered.
> 
> Being a bit of a newbie to web development (coming from database and
> basic native apps programming) I was hoping to see what people have
> come up with to get an idea of some possibilities for web apps.
> 
> Hope we could do something like this again. Maybe I'll submit one of
> my newbie apps. ;)
> 
> 
> On Aug 4, 6:22 pm, Mr admin  wrote:
> > The number of participants was two.
> >
> > Mr.NetAdmin
> >
> >
> >
> > On Wed, Aug 4, 2010 at 2:49 AM, mdipierro  wrote:
> > > Can you post some stats?
> > > Number of participants for example.
> >
> > > Massimo
> >
> > > On Aug 3, 2:01 pm, NetAdmin  wrote:
> > > > Hello All,
> >
> > > > The winners of the Web2py Application Exhibition have been e-mailed,
> > > > and I'm waiting for their replies before posting the results.
> >
> > > >  Mr.NetAdmin




Re: [web2py] Post you apps

2010-08-07 Thread Jason Brower
Thanks!
I can feel plugins and autoinstalling coming along!
BR,
Jason

On Fri, 2010-08-06 at 15:59 -0700, mdipierro wrote: 
> Now you can post and updated your apps here without asking me.
> 
> http://web2py.com/appliances
> 
> Massimo




Re: [web2py] Re: Web2py Application Exhibition -- Winners!

2010-08-07 Thread Vasile Ermicioi
me too


[web2py] Re: WOW!!

2010-08-07 Thread david.waldrop
I have now got the url working via DNS as suggested.  But encountered
another problem.  I would like for each community to have a separate
database.  Whenever I creaet a new community database and
corresponding tables they are physically intermixed with teh SQLLite
storage folder of the main/global database.  How can I get the current
storage location and create new folders in the OS to house the
corresponding database and table files.  Below is an illustration of
what I would the resulting file structure to be want:

MyAPP
databases
storage.sqlite
c2628476264624626_communities.table
   <<>>>
   My first community
storage.sqlite
d32753728973493784_events.table
<< wrote:
> Some domain register supports "wild chars" in your domain name, so all
> requests to "*.yourdomain.com" can reach your site.
>
> If you prefer the other style, try web2py/route.py
>
> On Jul 24, 10:59pm, "david.waldrop"  wrote:
>
>
>
> > Thnaks for the reply, but I think I was not clear.  I se form you
> > example how to dynamically point to a seperate DB.  But regarding the
> > url, users can create communities on the fly and henei I would like to
> > avoid having to register each one with DNS.  The main use behined a
> > seperate URL is to make it easy for communities to be shared.  So for
> > example I could inviet my neoighbor by simply email a link.   They in
> > turn coud do the same and invite others.  I was thinking of a link
> > like this:
>
> >www.mydomain.com/mycommunity1 orwww.mydomain.com\tallyhoswimclub
>
> > where the suffix uniquely identifies the community.  I see that web2py
> > controls the url naming and am not sure how this scheme would impact
> > the typical url suffixes that actuall provide functionality (i.e.
> > about, leit, new posing, etc.) and ofetn related to a view and.or
> > controler.
>
> > Any ideas?
>
> > On Jul 22, 6:47 pm, mdipierro  wrote:
>
> > > Thanks
>
> > > you can do this. register a domain like mydomain.com and access it as
>
> > >http://mycommunty.mydomain.com
>
> > > in the model file you can do:
>
> > >    community = request.env.host_name.split('.')[0]
> > >    db=DAL('sqlite://storage.%s.sqlite' % community)
>
> > > and that should be all you need.
>
> > > On Jul 22, 1:58 pm, "david.waldrop"  wrote:
>
> > > > All, I just discovered this amazing framework and am immediately
> > > > switching to it (from adobe) for a current project I am working on.
> > > > It is quite different from the way I have built solutions in the
> > > > past.  Here is the basic structure of how I need to approach the
> > > > problem:
>
> > > > 1) I want a user to log in and create a community based topic.
>
> > > > 2) This community topic should have a separate URL and database.  I
> > > > desire this for scaleability and privacy.  I asume the url will be
> > > > either the community topic name (or a GUID of some type, and am OK
> > > > with this)  suffixed to my domain.
>
> > > > 3) The organizer can freely share the url with others in their
> > > > neighborhood.
>
> > > > 4) All users will be required to register and login in.
>
> > > > 5) Users can participate in multiple community topics.  I think this
> > > > means there is a central database storing community topics and
> > > > participating users, thereby allowing the user to see a list of
> > > > community topics in which they are participating when they log in.
> > > > When they select a community topic (ideally represented by a URL to
> > > > aid in easily sharing) the app must somehow switch the underlying
> > > > database.
>
> > > > I am getting the hang of implementing the functionality within a
> > > > community, but have no real idea how to fulfill the above
> > > > requirements.  Any thoughts or suggestions would be greatly
> > > > appreciated.  Again,WOW, I cannot believe I have been unaware of
> > > > web2py!- Hide quoted text -
>
> > > - Show quoted text -


[web2py] Re: WOW!!

2010-08-07 Thread mdipierro
instead of

db=DAL('sqlite://storage.sqlite')

do

app='...' # somehow determine which name
db_path = os.path.join(request.folder,'databases',app)
if not os.path.exists(db_path): os.mkdir(db_path)
db=DAL('sqlite://%s/storage.sqlite' % app)

On Aug 7, 6:33 am, "david.waldrop"  wrote:
> I have now got the url working via DNS as suggested.  But encountered
> another problem.  I would like for each community to have a separate
> database.  Whenever I creaet a new community database and
> corresponding tables they are physically intermixed with teh SQLLite
> storage folder of the main/global database.  How can I get the current
> storage location and create new folders in the OS to house the
> corresponding database and table files.  Below is an illustration of
> what I would the resulting file structure to be want:
>
> MyAPP
>     databases
>         storage.sqlite
>         c2628476264624626_communities.table
>        <<>>>
>        My first community
>             storage.sqlite
>             d32753728973493784_events.table
>             <<        Fox Hills Swim Club
>             storage.sqlite
>             e98738957375937_events.table
>
> Note:  Each community will have the same tables (bit obviously with
> different data) and I realize this is specific to sqlite (which is ok
> for what I am doing).
>
> I think that what I do not know how to do is retrieve the current
> storage location (i.e. folder) and how to specif the location where
> DAL creates a new database.
>
> Thanks in advance for your assistance.
>
> On Jul 24, 11:56 am, Iceberg  wrote:
>
> > Some domain register supports "wild chars" in your domain name, so all
> > requests to "*.yourdomain.com" can reach your site.
>
> > If you prefer the other style, try web2py/route.py
>
> > On Jul 24, 10:59pm, "david.waldrop"  wrote:
>
> > > Thnaks for the reply, but I think I was not clear.  I se form you
> > > example how to dynamically point to a seperate DB.  But regarding the
> > > url, users can create communities on the fly and henei I would like to
> > > avoid having to register each one with DNS.  The main use behined a
> > > seperate URL is to make it easy for communities to be shared.  So for
> > > example I could inviet my neoighbor by simply email a link.   They in
> > > turn coud do the same and invite others.  I was thinking of a link
> > > like this:
>
> > >www.mydomain.com/mycommunity1 orwww.mydomain.com\tallyhoswimclub
>
> > > where the suffix uniquely identifies the community.  I see that web2py
> > > controls the url naming and am not sure how this scheme would impact
> > > the typical url suffixes that actuall provide functionality (i.e.
> > > about, leit, new posing, etc.) and ofetn related to a view and.or
> > > controler.
>
> > > Any ideas?
>
> > > On Jul 22, 6:47 pm, mdipierro  wrote:
>
> > > > Thanks
>
> > > > you can do this. register a domain like mydomain.com and access it as
>
> > > >http://mycommunty.mydomain.com
>
> > > > in the model file you can do:
>
> > > >    community = request.env.host_name.split('.')[0]
> > > >    db=DAL('sqlite://storage.%s.sqlite' % community)
>
> > > > and that should be all you need.
>
> > > > On Jul 22, 1:58 pm, "david.waldrop"  wrote:
>
> > > > > All, I just discovered this amazing framework and am immediately
> > > > > switching to it (from adobe) for a current project I am working on.
> > > > > It is quite different from the way I have built solutions in the
> > > > > past.  Here is the basic structure of how I need to approach the
> > > > > problem:
>
> > > > > 1) I want a user to log in and create a community based topic.
>
> > > > > 2) This community topic should have a separate URL and database.  I
> > > > > desire this for scaleability and privacy.  I asume the url will be
> > > > > either the community topic name (or a GUID of some type, and am OK
> > > > > with this)  suffixed to my domain.
>
> > > > > 3) The organizer can freely share the url with others in their
> > > > > neighborhood.
>
> > > > > 4) All users will be required to register and login in.
>
> > > > > 5) Users can participate in multiple community topics.  I think this
> > > > > means there is a central database storing community topics and
> > > > > participating users, thereby allowing the user to see a list of
> > > > > community topics in which they are participating when they log in.
> > > > > When they select a community topic (ideally represented by a URL to
> > > > > aid in easily sharing) the app must somehow switch the underlying
> > > > > database.
>
> > > > > I am getting the hang of implementing the functionality within a
> > > > > community, but have no real idea how to fulfill the above
> > > > > requirements.  Any thoughts or suggestions would be greatly
> > > > > appreciated.  Again,WOW, I cannot believe I have been unaware of
> > > > > web2py!- Hide quoted text -
>
> > > > - Show quoted text -


[web2py] new blog entry about web2py

2010-08-07 Thread stefaan
Sorry if this appeared here before.

http://www.franciscosouza.net/2010/08/flying-with-web2py-in-google-app-engine.html



[web2py] Re: WOW!!

2010-08-07 Thread david.waldrop
worked perfectly.  I am a happy camper.  One thing I am uneasy with is
knowing if it's "ok" to define databases and tables in a controller,
where to put inport statements, and in general how to partition code.
Is there a particilarly good app you would recccomend as a reference
or a place to read about web2py application architecture???

On Aug 7, 7:39 am, mdipierro  wrote:
> instead of
>
> db=DAL('sqlite://storage.sqlite')
>
> do
>
> app='...' # somehow determine which name
> db_path = os.path.join(request.folder,'databases',app)
> if not os.path.exists(db_path): os.mkdir(db_path)
> db=DAL('sqlite://%s/storage.sqlite' % app)
>
> On Aug 7, 6:33 am, "david.waldrop"  wrote:
>
>
>
> > I have now got the url working via DNS as suggested.  But encountered
> > another problem.  I would like for each community to have a separate
> > database.  Whenever I creaet a new community database and
> > corresponding tables they are physically intermixed with teh SQLLite
> > storage folder of the main/global database.  How can I get the current
> > storage location and create new folders in the OS to house the
> > corresponding database and table files.  Below is an illustration of
> > what I would the resulting file structure to be want:
>
> > MyAPP
> >     databases
> >         storage.sqlite
> >         c2628476264624626_communities.table
> >        <<>>>
> >        My first community
> >             storage.sqlite
> >             d32753728973493784_events.table
> >             << >        Fox Hills Swim Club
> >             storage.sqlite
> >             e98738957375937_events.table
>
> > Note:  Each community will have the same tables (bit obviously with
> > different data) and I realize this is specific to sqlite (which is ok
> > for what I am doing).
>
> > I think that what I do not know how to do is retrieve the current
> > storage location (i.e. folder) and how to specif the location where
> > DAL creates a new database.
>
> > Thanks in advance for your assistance.
>
> > On Jul 24, 11:56 am, Iceberg  wrote:
>
> > > Some domain register supports "wild chars" in your domain name, so all
> > > requests to "*.yourdomain.com" can reach your site.
>
> > > If you prefer the other style, try web2py/route.py
>
> > > On Jul 24, 10:59pm, "david.waldrop"  wrote:
>
> > > > Thnaks for the reply, but I think I was not clear.  I se form you
> > > > example how to dynamically point to a seperate DB.  But regarding the
> > > > url, users can create communities on the fly and henei I would like to
> > > > avoid having to register each one with DNS.  The main use behined a
> > > > seperate URL is to make it easy for communities to be shared.  So for
> > > > example I could inviet my neoighbor by simply email a link.   They in
> > > > turn coud do the same and invite others.  I was thinking of a link
> > > > like this:
>
> > > >www.mydomain.com/mycommunity1 orwww.mydomain.com\tallyhoswimclub
>
> > > > where the suffix uniquely identifies the community.  I see that web2py
> > > > controls the url naming and am not sure how this scheme would impact
> > > > the typical url suffixes that actuall provide functionality (i.e.
> > > > about, leit, new posing, etc.) and ofetn related to a view and.or
> > > > controler.
>
> > > > Any ideas?
>
> > > > On Jul 22, 6:47 pm, mdipierro  wrote:
>
> > > > > Thanks
>
> > > > > you can do this. register a domain like mydomain.com and access it as
>
> > > > >http://mycommunty.mydomain.com
>
> > > > > in the model file you can do:
>
> > > > >    community = request.env.host_name.split('.')[0]
> > > > >    db=DAL('sqlite://storage.%s.sqlite' % community)
>
> > > > > and that should be all you need.
>
> > > > > On Jul 22, 1:58 pm, "david.waldrop"  wrote:
>
> > > > > > All, I just discovered this amazing framework and am immediately
> > > > > > switching to it (from adobe) for a current project I am working on.
> > > > > > It is quite different from the way I have built solutions in the
> > > > > > past.  Here is the basic structure of how I need to approach the
> > > > > > problem:
>
> > > > > > 1) I want a user to log in and create a community based topic.
>
> > > > > > 2) This community topic should have a separate URL and database.  I
> > > > > > desire this for scaleability and privacy.  I asume the url will be
> > > > > > either the community topic name (or a GUID of some type, and am OK
> > > > > > with this)  suffixed to my domain.
>
> > > > > > 3) The organizer can freely share the url with others in their
> > > > > > neighborhood.
>
> > > > > > 4) All users will be required to register and login in.
>
> > > > > > 5) Users can participate in multiple community topics.  I think this
> > > > > > means there is a central database storing community topics and
> > > > > > participating users, thereby allowing the user to see a list of
> > > > > > community topics in which they are participating when they log in.
> > > > > > When they select a community topic (ideally represented by a URL to
> > > > > > ai

[web2py] Re: WOW!!

2010-08-07 Thread david.waldrop
well almost perfectly.  below is my code:

app=community.name
db_path = os.path.join(request.folder,'databases',app)
if not os.path.exists(db_path): os.mkdir(db_path)
mtgdb=DAL('sqlite://%s/storage.sqlite' % app)

mtgdb.define_table(
'thoughts',
Field('description','text'),
Field('author','string'),
Field('votes','integer')
)
mtgdb.thoughts.description.requires = IS_NOT_EMPTY()

the result is a new sub-folder created in the databases folder of my
app with the name of the ciommunity.   The problem is the "thoughts"
table is not created in the community sub-folder, but rather the
databases folder.  I looked up the syntax of the define_table method,
buit do not see a way to override the location.



On Aug 7, 9:38 am, "david.waldrop"  wrote:
> worked perfectly.  I am a happy camper.  One thing I am uneasy with is
> knowing if it's "ok" to define databases and tables in a controller,
> where to put inport statements, and in general how to partition code.
> Is there a particilarly good app you would recccomend as a reference
> or a place to read about web2py application architecture???
>
> On Aug 7, 7:39 am, mdipierro  wrote:
>
>
>
> > instead of
>
> > db=DAL('sqlite://storage.sqlite')
>
> > do
>
> > app='...' # somehow determine which name
> > db_path = os.path.join(request.folder,'databases',app)
> > if not os.path.exists(db_path): os.mkdir(db_path)
> > db=DAL('sqlite://%s/storage.sqlite' % app)
>
> > On Aug 7, 6:33 am, "david.waldrop"  wrote:
>
> > > I have now got the url working via DNS as suggested.  But encountered
> > > another problem.  I would like for each community to have a separate
> > > database.  Whenever I creaet a new community database and
> > > corresponding tables they are physically intermixed with teh SQLLite
> > > storage folder of the main/global database.  How can I get the current
> > > storage location and create new folders in the OS to house the
> > > corresponding database and table files.  Below is an illustration of
> > > what I would the resulting file structure to be want:
>
> > > MyAPP
> > >     databases
> > >         storage.sqlite
> > >         c2628476264624626_communities.table
> > >        <<>>>
> > >        My first community
> > >             storage.sqlite
> > >             d32753728973493784_events.table
> > >             << > >        Fox Hills Swim Club
> > >             storage.sqlite
> > >             e98738957375937_events.table
>
> > > Note:  Each community will have the same tables (bit obviously with
> > > different data) and I realize this is specific to sqlite (which is ok
> > > for what I am doing).
>
> > > I think that what I do not know how to do is retrieve the current
> > > storage location (i.e. folder) and how to specif the location where
> > > DAL creates a new database.
>
> > > Thanks in advance for your assistance.
>
> > > On Jul 24, 11:56 am, Iceberg  wrote:
>
> > > > Some domain register supports "wild chars" in your domain name, so all
> > > > requests to "*.yourdomain.com" can reach your site.
>
> > > > If you prefer the other style, try web2py/route.py
>
> > > > On Jul 24, 10:59pm, "david.waldrop"  wrote:
>
> > > > > Thnaks for the reply, but I think I was not clear.  I se form you
> > > > > example how to dynamically point to a seperate DB.  But regarding the
> > > > > url, users can create communities on the fly and henei I would like to
> > > > > avoid having to register each one with DNS.  The main use behined a
> > > > > seperate URL is to make it easy for communities to be shared.  So for
> > > > > example I could inviet my neoighbor by simply email a link.   They in
> > > > > turn coud do the same and invite others.  I was thinking of a link
> > > > > like this:
>
> > > > >www.mydomain.com/mycommunity1 orwww.mydomain.com\tallyhoswimclub
>
> > > > > where the suffix uniquely identifies the community.  I see that web2py
> > > > > controls the url naming and am not sure how this scheme would impact
> > > > > the typical url suffixes that actuall provide functionality (i.e.
> > > > > about, leit, new posing, etc.) and ofetn related to a view and.or
> > > > > controler.
>
> > > > > Any ideas?
>
> > > > > On Jul 22, 6:47 pm, mdipierro  wrote:
>
> > > > > > Thanks
>
> > > > > > you can do this. register a domain like mydomain.com and access it 
> > > > > > as
>
> > > > > >http://mycommunty.mydomain.com
>
> > > > > > in the model file you can do:
>
> > > > > >    community = request.env.host_name.split('.')[0]
> > > > > >    db=DAL('sqlite://storage.%s.sqlite' % community)
>
> > > > > > and that should be all you need.
>
> > > > > > On Jul 22, 1:58 pm, "david.waldrop"  wrote:
>
> > > > > > > All, I just discovered this amazing framework and am immediately
> > > > > > > switching to it (from adobe) for a current project I am working 
> > > > > > > on.
> > > > > > > It is quite different from the way I have built solutions in the
> > > > > > > past.  Here is the basic structure of how I need to approa

[web2py] Re: WOW!!

2010-08-07 Thread mdipierro
please try both

mtgdb=DAL('sqlite://%s/storage.sqlite' % app, folder=db_path)

and

mtgdb=DAL('sqlite://storage.sqlite', folder=db_path)

I am sure one works but I do not recall which one. Let us know.

On Aug 7, 8:55 am, "david.waldrop"  wrote:
> well almost perfectly.  below is my code:
>
>     app=community.name
>     db_path = os.path.join(request.folder,'databases',app)
>     if not os.path.exists(db_path): os.mkdir(db_path)
>     mtgdb=DAL('sqlite://%s/storage.sqlite' % app)
>
>     mtgdb.define_table(
>     'thoughts',
>     Field('description','text'),
>     Field('author','string'),
>     Field('votes','integer')
>     )
>     mtgdb.thoughts.description.requires = IS_NOT_EMPTY()
>
> the result is a new sub-folder created in the databases folder of my
> app with the name of the ciommunity.   The problem is the "thoughts"
> table is not created in the community sub-folder, but rather the
> databases folder.  I looked up the syntax of the define_table method,
> buit do not see a way to override the location.
>
> On Aug 7, 9:38 am, "david.waldrop"  wrote:
>
> > worked perfectly.  I am a happy camper.  One thing I am uneasy with is
> > knowing if it's "ok" to define databases and tables in a controller,
> > where to put inport statements, and in general how to partition code.
> > Is there a particilarly good app you would recccomend as a reference
> > or a place to read about web2py application architecture???
>
> > On Aug 7, 7:39 am, mdipierro  wrote:
>
> > > instead of
>
> > > db=DAL('sqlite://storage.sqlite')
>
> > > do
>
> > > app='...' # somehow determine which name
> > > db_path = os.path.join(request.folder,'databases',app)
> > > if not os.path.exists(db_path): os.mkdir(db_path)
> > > db=DAL('sqlite://%s/storage.sqlite' % app)
>
> > > On Aug 7, 6:33 am, "david.waldrop"  wrote:
>
> > > > I have now got the url working via DNS as suggested.  But encountered
> > > > another problem.  I would like for each community to have a separate
> > > > database.  Whenever I creaet a new community database and
> > > > corresponding tables they are physically intermixed with teh SQLLite
> > > > storage folder of the main/global database.  How can I get the current
> > > > storage location and create new folders in the OS to house the
> > > > corresponding database and table files.  Below is an illustration of
> > > > what I would the resulting file structure to be want:
>
> > > > MyAPP
> > > >     databases
> > > >         storage.sqlite
> > > >         c2628476264624626_communities.table
> > > >        <<>>>
> > > >        My first community
> > > >             storage.sqlite
> > > >             d32753728973493784_events.table
> > > >             << > > >        Fox Hills Swim Club
> > > >             storage.sqlite
> > > >             e98738957375937_events.table
>
> > > > Note:  Each community will have the same tables (bit obviously with
> > > > different data) and I realize this is specific to sqlite (which is ok
> > > > for what I am doing).
>
> > > > I think that what I do not know how to do is retrieve the current
> > > > storage location (i.e. folder) and how to specif the location where
> > > > DAL creates a new database.
>
> > > > Thanks in advance for your assistance.
>
> > > > On Jul 24, 11:56 am, Iceberg  wrote:
>
> > > > > Some domain register supports "wild chars" in your domain name, so all
> > > > > requests to "*.yourdomain.com" can reach your site.
>
> > > > > If you prefer the other style, try web2py/route.py
>
> > > > > On Jul 24, 10:59pm, "david.waldrop"  wrote:
>
> > > > > > Thnaks for the reply, but I think I was not clear.  I se form you
> > > > > > example how to dynamically point to a seperate DB.  But regarding 
> > > > > > the
> > > > > > url, users can create communities on the fly and henei I would like 
> > > > > > to
> > > > > > avoid having to register each one with DNS.  The main use behined a
> > > > > > seperate URL is to make it easy for communities to be shared.  So 
> > > > > > for
> > > > > > example I could inviet my neoighbor by simply email a link.   They 
> > > > > > in
> > > > > > turn coud do the same and invite others.  I was thinking of a link
> > > > > > like this:
>
> > > > > >www.mydomain.com/mycommunity1 orwww.mydomain.com\tallyhoswimclub
>
> > > > > > where the suffix uniquely identifies the community.  I see that 
> > > > > > web2py
> > > > > > controls the url naming and am not sure how this scheme would impact
> > > > > > the typical url suffixes that actuall provide functionality (i.e.
> > > > > > about, leit, new posing, etc.) and ofetn related to a view and.or
> > > > > > controler.
>
> > > > > > Any ideas?
>
> > > > > > On Jul 22, 6:47 pm, mdipierro  wrote:
>
> > > > > > > Thanks
>
> > > > > > > you can do this. register a domain like mydomain.com and access 
> > > > > > > it as
>
> > > > > > >http://mycommunty.mydomain.com
>
> > > > > > > in the model file you can do:
>
> > > > > > >    community = request.env.host_name.split('.')[0]
> > > > > > > 

[web2py] Re: Failed to connect to PostgreSQL, deployed with setup_web2py_ubuntu.sh.

2010-08-07 Thread mdipierro
One more test:

In gluon/sql.py

before line 957, print your connection string:
   print msg
Would that connection string work on the shell? Which postgresql
version are you using?


On Aug 6, 6:48 am, Zhe Li  wrote:
> Yeah, that works fine. It's so odd and frustrating...
>
> On Aug 6, 1:25 pm, mdipierro  wrote:
>
> > I have no idea. Can you connect from a pure python shell using the
> > driver API?
>
> > On Aug 6, 5:55 am, Zhe Li  wrote:
>
> > > thanks!
> > > I tried to replace localhost with 127.0.0.1, 192.168.0.16 (it's
> > > actually ip). but it doesn't work
>
> > > Cheers,
> > > Zhe
>
> > > On Aug 6, 12:33 pm, mdipierro  wrote:
>
> > > > Try replace
>
> > > > localhost
> > > > with
> > > > 127.0.0.1
> > > > and with the actual IP of the machine. It may not be serving on
> > > > localhost
>
> > > > On Aug 6, 5:25 am, Zhe Li  wrote:
>
> > > > > Hi,
>
> > > > > Thanks! This is the result from trunk.
>
> > > > > Error traceback
> > > > > Traceback (most recent call last):
> > > > >   File "gluon/restricted.py", line 186, in restricted
> > > > >     exec ccode in environment
> > > > >   File "/home/www-data/web2py/applications/welcome/models/db.py", line
> > > > > 15, in 
> > > > >     db = DAL('postgres://web2py:test...@localhost:1216/labdb')       #
> > > > > if not, use SQLite or other DB
> > > > >   File "gluon/sql.py", line 3911, in DAL
> > > > >     raise RuntimeError, "%s (tried 5 times)" % exception
> > > > > RuntimeError: could not connect to server: Connection refused
> > > > >     Is the server running on host "localhost" and accepting
> > > > >     TCP/IP connections on port 1216?
> > > > > could not connect to server: Connection refused
> > > > >     Is the server running on host "localhost" and accepting
> > > > >     TCP/IP connections on port 1216?
> > > > >  (tried 5 times)
> > > > > Error snapshot
> > > > > Detailed traceback description
> > > > > Exception: (could not connect to
> > > > > server: Connection refused Is the server running on host "localhost"
> > > > > and accepting TCP/IP connections on port 1216? could not connect to
> > > > > server: Connection refused Is the server running on host "localhost"
> > > > > and accepting TCP/IP connections on port 1216? (tried 5 times))
> > > > > Python 2.6.5: /usr/bin/python
>
> > > > > This is odd since I can connect to it both from command-line and
> > > > > another machine using web2py account
>
> > > > > Cheers,
> > > > > Zhe
>
> > > > > On Aug 6, 11:06 am, mdipierro  wrote:
>
> > > > > > Please check the version in trunk. It should give you a more 
> > > > > > detailed
> > > > > > error.
>
> > > > > > On Aug 6, 3:06 am, Zhe Li  wrote:
>
> > > > > > > Hello everyone,
>
> > > > > > > I tried to deploy web2py on my ubuntu server using
> > > > > > > setup_web2py_ubuntu.sh. Everything seemed fine except when I 
> > > > > > > switch
> > > > > > > database from SQLite to PostgreSQL I got:
>
> > > > > > > Error traceback
> > > > > > > Traceback (most recent call last):
> > > > > > >   File "gluon/restricted.py", line 178, in restricted
> > > > > > >     exec ccode in environment
> > > > > > >   File "/home/www-data/web2py/applications/init/models/db.py", 
> > > > > > > line
> > > > > > > 16, in 
> > > > > > >     db = DAL('postgres://web2py:12...@127.0.0.1:1216/labdb',
> > > > > > > pool_size=10)
> > > > > > >   File "gluon/sql.py", line 3911, in DAL
> > > > > > >     raise RuntimeError, "Failure to connect to DB. Tried 5 times"
> > > > > > > RuntimeError: Failure to connect to DB. Tried 5 times
>
> > > > > > > but if I run the web server using:
>
> > > > > > > python web2.py
>
> > > > > > > it works fine. I got the same issue with MySQL as well.
>
> > > > > > > Could you tell me what the problem might be? Thanks!
>
> > > > > > > Cheers,
> > > > > > > Zhe


[web2py] Re: WOW!!

2010-08-07 Thread david.waldrop
this one worked:

 
mtgdb=DAL('sqlite://storage.sqlite', folder=db_path)

very cool.  thanks a million

On Aug 7, 11:20 am, mdipierro  wrote:
> please try both
>
> mtgdb=DAL('sqlite://%s/storage.sqlite' % app, folder=db_path)
>
> and
>
> mtgdb=DAL('sqlite://storage.sqlite', folder=db_path)
>
> I am sure one works but I do not recall which one. Let us know.
>
> On Aug 7, 8:55 am, "david.waldrop"  wrote:
>
>
>
> > well almost perfectly.  below is my code:
>
> >     app=community.name
> >     db_path = os.path.join(request.folder,'databases',app)
> >     if not os.path.exists(db_path): os.mkdir(db_path)
> >     mtgdb=DAL('sqlite://%s/storage.sqlite' % app)
>
> >     mtgdb.define_table(
> >     'thoughts',
> >     Field('description','text'),
> >     Field('author','string'),
> >     Field('votes','integer')
> >     )
> >     mtgdb.thoughts.description.requires = IS_NOT_EMPTY()
>
> > the result is a new sub-folder created in the databases folder of my
> > app with the name of the ciommunity.   The problem is the "thoughts"
> > table is not created in the community sub-folder, but rather the
> > databases folder.  I looked up the syntax of the define_table method,
> > buit do not see a way to override the location.
>
> > On Aug 7, 9:38 am, "david.waldrop"  wrote:
>
> > > worked perfectly.  I am a happy camper.  One thing I am uneasy with is
> > > knowing if it's "ok" to define databases and tables in a controller,
> > > where to put inport statements, and in general how to partition code.
> > > Is there a particilarly good app you would recccomend as a reference
> > > or a place to read about web2py application architecture???
>
> > > On Aug 7, 7:39 am, mdipierro  wrote:
>
> > > > instead of
>
> > > > db=DAL('sqlite://storage.sqlite')
>
> > > > do
>
> > > > app='...' # somehow determine which name
> > > > db_path = os.path.join(request.folder,'databases',app)
> > > > if not os.path.exists(db_path): os.mkdir(db_path)
> > > > db=DAL('sqlite://%s/storage.sqlite' % app)
>
> > > > On Aug 7, 6:33 am, "david.waldrop"  wrote:
>
> > > > > I have now got the url working via DNS as suggested.  But encountered
> > > > > another problem.  I would like for each community to have a separate
> > > > > database.  Whenever I creaet a new community database and
> > > > > corresponding tables they are physically intermixed with teh SQLLite
> > > > > storage folder of the main/global database.  How can I get the current
> > > > > storage location and create new folders in the OS to house the
> > > > > corresponding database and table files.  Below is an illustration of
> > > > > what I would the resulting file structure to be want:
>
> > > > > MyAPP
> > > > >     databases
> > > > >         storage.sqlite
> > > > >         c2628476264624626_communities.table
> > > > >        <<>>>
> > > > >        My first community
> > > > >             storage.sqlite
> > > > >             d32753728973493784_events.table
> > > > >             << > > > >        Fox Hills Swim Club
> > > > >             storage.sqlite
> > > > >             e98738957375937_events.table
>
> > > > > Note:  Each community will have the same tables (bit obviously with
> > > > > different data) and I realize this is specific to sqlite (which is ok
> > > > > for what I am doing).
>
> > > > > I think that what I do not know how to do is retrieve the current
> > > > > storage location (i.e. folder) and how to specif the location where
> > > > > DAL creates a new database.
>
> > > > > Thanks in advance for your assistance.
>
> > > > > On Jul 24, 11:56 am, Iceberg  wrote:
>
> > > > > > Some domain register supports "wild chars" in your domain name, so 
> > > > > > all
> > > > > > requests to "*.yourdomain.com" can reach your site.
>
> > > > > > If you prefer the other style, try web2py/route.py
>
> > > > > > On Jul 24, 10:59pm, "david.waldrop"  wrote:
>
> > > > > > > Thnaks for the reply, but I think I was not clear.  I se form you
> > > > > > > example how to dynamically point to a seperate DB.  But regarding 
> > > > > > > the
> > > > > > > url, users can create communities on the fly and henei I would 
> > > > > > > like to
> > > > > > > avoid having to register each one with DNS.  The main use behined 
> > > > > > > a
> > > > > > > seperate URL is to make it easy for communities to be shared.  So 
> > > > > > > for
> > > > > > > example I could inviet my neoighbor by simply email a link.   
> > > > > > > They in
> > > > > > > turn coud do the same and invite others.  I was thinking of a link
> > > > > > > like this:
>
> > > > > > >www.mydomain.com/mycommunity1 orwww.mydomain.com\tallyhoswimclub
>
> > > > > > > where the suffix uniquely identifies the community.  I see that 
> > > > > > > web2py
> > > > > > > controls the url naming and am not sure how this scheme would 
> > > > > > > impact
> > > > > > > the typical url suffixes that actuall provide functionality (i.e.
> > > > > > > about, leit, new posing, etc.) and ofetn related to a view and.or
> > > > > > > control

[web2py] looking for work?

2010-08-07 Thread mdipierro
Are you in US?
Have you contributed to web2py or developed something I can look at?
Looking for a paid project to work on?

Please contact me confidentially.

DO NOT REPLY to this thread.


[web2py] per app routes

2010-08-07 Thread mdipierro
Thanks to Jonathan Lundell we have an experimental version in trunk of
app level routes.
To understand how it works read routes.example.py and comments in the
file gluon/rewrite.py

If you test it please report your findings here.

Massimo


Re: [web2py] per app routes

2010-08-07 Thread Jonathan Lundell
On Aug 7, 2010, at 9:03 AM, mdipierro wrote:

> Thanks to Jonathan Lundell we have an experimental version in trunk of
> app level routes.
> To understand how it works read routes.example.py and comments in the
> file gluon/rewrite.py
> 
> If you test it please report your findings here.

*Very* experimental, mostly not tested. 

I'll describe some of the changes here.

1. If you don't explicitly invoke any of the new features, routing should 
behave identically to before. If you see any different, please let us know asap.

2. You can now have a routes.py in the top level folder of an application, and 
it will be used *instead* of the base routes.py. However, it's not enough to 
simply have the file there; you must inform the routing logic about it.

3. The way you inform the routing logic is with a new element in the base 
routes.py: routes_app. routes_app is processed identically to routes_in, but 
the output must be an app name (or nothing). routes_app is processed at the 
beginning of a request. If it produces an app name, and that app has an 
app-specific routes.py (that is, applications/appname/routes.py), then that 
routes.py is used instead of the base routes.py.

4. In an unrelated change, there are three other new elements in routes.py:

default_application = "init"
default_controller = "default"
default_function = "index"

Note that default_application doesn't interact with app-specfic routing, since 
it's used after rewrite has taken place. default_controller and 
default_function should normally be used only in an app-specific routes.py, 
because, in the base routes.py, they will apply to all apps *without* an 
app-specific routes.py. That would probably lead to confusion when running 
admin or examples; at the very least their defaults would break.

5. As usual, I suggest that when you edit routes.example.py to generate a new 
routes.py, you also edit the doctest at the end, and use it to verify that 
you're getting what you expect. To run the doctest, just do "python routes.py".


Note also that I have a more far-reaching change in mind, but don't have it 
worked out yet. The new version will move away from regexes (though the old 
logic will remain in place for compatibility). It's supposed to be more 
flexible and much easier to use, and also handle URL encoding & decoding 
better. But this change should help in the meantime.

[web2py] Re: per app routes

2010-08-07 Thread David Marko
Hello,
have you tested performance impact on application. Do you assume some
noticeable slowdown when using routes?

david

On 7 srp, 18:26, Jonathan Lundell  wrote:
> On Aug 7, 2010, at 9:03 AM, mdipierro wrote:
>
> > Thanks to Jonathan Lundell we have an experimental version in trunk of
> > app level routes.
> > To understand how it works read routes.example.py and comments in the
> > file gluon/rewrite.py
>
> > If you test it please report your findings here.
>
> *Very* experimental, mostly not tested.
>
> I'll describe some of the changes here.
>
> 1. If you don't explicitly invoke any of the new features, routing should 
> behave identically to before. If you see any different, please let us know 
> asap.
>
> 2. You can now have a routes.py in the top level folder of an application, 
> and it will be used *instead* of the base routes.py. However, it's not enough 
> to simply have the file there; you must inform the routing logic about it.
>
> 3. The way you inform the routing logic is with a new element in the base 
> routes.py: routes_app. routes_app is processed identically to routes_in, but 
> the output must be an app name (or nothing). routes_app is processed at the 
> beginning of a request. If it produces an app name, and that app has an 
> app-specific routes.py (that is, applications/appname/routes.py), then that 
> routes.py is used instead of the base routes.py.
>
> 4. In an unrelated change, there are three other new elements in routes.py:
>
> default_application = "init"
> default_controller = "default"
> default_function = "index"
>
> Note that default_application doesn't interact with app-specfic routing, 
> since it's used after rewrite has taken place. default_controller and 
> default_function should normally be used only in an app-specific routes.py, 
> because, in the base routes.py, they will apply to all apps *without* an 
> app-specific routes.py. That would probably lead to confusion when running 
> admin or examples; at the very least their defaults would break.
>
> 5. As usual, I suggest that when you edit routes.example.py to generate a new 
> routes.py, you also edit the doctest at the end, and use it to verify that 
> you're getting what you expect. To run the doctest, just do "python 
> routes.py".
>
> Note also that I have a more far-reaching change in mind, but don't have it 
> worked out yet. The new version will move away from regexes (though the old 
> logic will remain in place for compatibility). It's supposed to be more 
> flexible and much easier to use, and also handle URL encoding & decoding 
> better. But this change should help in the meantime.


[web2py] simulating inline forms with SQLFORMS

2010-08-07 Thread david.waldrop
I am having trouble controlling the visual aspects fo a SQLFORM.  More
specifically, I want to enable a text box and a POST button on the top
of the screen and have a lsit display below it.  The list is gonna be
quite large so I do not want the default 2" text box and the button
below it, but rather a single line of input (that can accept any
mnumber of characters) and the POST button right beside it
vertically.  I played around with the formstyles, but there is not
very good examples.  Any suggestion/examples would be appreciated?


Re: [web2py] Re: per app routes

2010-08-07 Thread Jonathan Lundell
On Aug 7, 2010, at 9:32 AM, David Marko wrote:

> Hello,
> have you tested performance impact on application. Do you assume some
> noticeable slowdown when using routes?

I have not measured it, but I'd expect the effect to be trivial, perhaps 
unmeasurable in that it'd be in the noise.

In particular, the routing files are read and the regexes compiled only once, 
when web2py starts up, so the per-request overhead is quite low.

> 
> david
> 
> On 7 srp, 18:26, Jonathan Lundell  wrote:
>> On Aug 7, 2010, at 9:03 AM, mdipierro wrote:
>> 
>>> Thanks to Jonathan Lundell we have an experimental version in trunk of
>>> app level routes.
>>> To understand how it works read routes.example.py and comments in the
>>> file gluon/rewrite.py
>> 
>>> If you test it please report your findings here.
>> 
>> *Very* experimental, mostly not tested.
>> 
>> I'll describe some of the changes here.
>> 
>> 1. If you don't explicitly invoke any of the new features, routing should 
>> behave identically to before. If you see any different, please let us know 
>> asap.
>> 
>> 2. You can now have a routes.py in the top level folder of an application, 
>> and it will be used *instead* of the base routes.py. However, it's not 
>> enough to simply have the file there; you must inform the routing logic 
>> about it.
>> 
>> 3. The way you inform the routing logic is with a new element in the base 
>> routes.py: routes_app. routes_app is processed identically to routes_in, but 
>> the output must be an app name (or nothing). routes_app is processed at the 
>> beginning of a request. If it produces an app name, and that app has an 
>> app-specific routes.py (that is, applications/appname/routes.py), then that 
>> routes.py is used instead of the base routes.py.
>> 
>> 4. In an unrelated change, there are three other new elements in routes.py:
>> 
>> default_application = "init"
>> default_controller = "default"
>> default_function = "index"
>> 
>> Note that default_application doesn't interact with app-specfic routing, 
>> since it's used after rewrite has taken place. default_controller and 
>> default_function should normally be used only in an app-specific routes.py, 
>> because, in the base routes.py, they will apply to all apps *without* an 
>> app-specific routes.py. That would probably lead to confusion when running 
>> admin or examples; at the very least their defaults would break.
>> 
>> 5. As usual, I suggest that when you edit routes.example.py to generate a 
>> new routes.py, you also edit the doctest at the end, and use it to verify 
>> that you're getting what you expect. To run the doctest, just do "python 
>> routes.py".
>> 
>> Note also that I have a more far-reaching change in mind, but don't have it 
>> worked out yet. The new version will move away from regexes (though the old 
>> logic will remain in place for compatibility). It's supposed to be more 
>> flexible and much easier to use, and also handle URL encoding & decoding 
>> better. But this change should help in the meantime.




[web2py] Re: simulating inline forms with SQLFORMS

2010-08-07 Thread mdipierro
{{if form.errors:}}
 error are {{=form.errors}}
{{pass}}
{{=form.custom.begin}}
{{=form.custom.submit}}
 
{{=form.custom.end}}


On Aug 7, 11:34 am, "david.waldrop"  wrote:
> I am having trouble controlling the visual aspects fo a SQLFORM.  More
> specifically, I want to enable a text box and a POST button on the top
> of the screen and have a lsit display below it.  The list is gonna be
> quite large so I do not want the default 2" text box and the button
> below it, but rather a single line of input (that can accept any
> mnumber of characters) and the POST button right beside it
> vertically.  I played around with the formstyles, but there is not
> very good examples.  Any suggestion/examples would be appreciated?


[web2py] Re: simulating inline forms with SQLFORMS

2010-08-07 Thread david.waldrop
i dont quite follow.  Here is my code

mtgdb.define_table(
'thoughts',
Field('description','text'),
Field('author','string'),
Field('votes','integer')
)

ideaform = SQLFORM(mtgdb.thoughts, fields=['description'],
submit_button='Post', formstyle='divs')
if ideaform.accepts(request.vars, session):
response.flash = 'form accepted'
elif ideaform.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill out the form'

it creates a form that takes up approximately  3" of the avialiabe
real estate.  Because teh description field is of type text and teh
"Post" button is underneath it.  What I want is something like this:

+---
+
|
|POST
+---
+

I found a post with custom widgets and something even more complex
with the formstyle stuff, but have to believe there is a simpler way.

On Aug 7, 12:39 pm, mdipierro  wrote:
> {{if form.errors:}}
>  error are {{=form.errors}}
> {{pass}}
> {{=form.custom.begin}}
> {{=form.custom.submit}}
>  
> {{=form.custom.end}}
>
> On Aug 7, 11:34 am, "david.waldrop"  wrote:
>
>
>
> > I am having trouble controlling the visual aspects fo a SQLFORM.  More
> > specifically, I want to enable a text box and a POST button on the top
> > of the screen and have a lsit display below it.  The list is gonna be
> > quite large so I do not want the default 2" text box and the button
> > below it, but rather a single line of input (that can accept any
> > mnumber of characters) and the POST button right beside it
> > vertically.  I played around with the formstyles, but there is not
> > very good examples.  Any suggestion/examples would be appreciated?


[web2py] Re: problem with boolean field in SQLFORM.factory

2010-08-07 Thread marcelielapointe
It works fine.

Thanks!!

On Aug 6, 5:28 pm, mdipierro  wrote:
> If a field is unchecked then it is not submitted in request.vars (that
> is how html forms work). You can use
>
> request.vars.get(field,False)
>
> or
>
> form.vars[field]
>
> (as Thadeus suggested)
>
> Massimo
>
> On Aug 6, 4:17 pm, marcelielapointe 
> wrote:
>
>
>
> > Hi,
>
> > I want to acces request.vars.name_of_my_field, with
> > request.vars['name_of_my_field'] with boolean field but if the field
> > is unchecked (false) I got a KeyError like if field was not existing.
>
> > Here is an example controller:
>
> > def main():
>
> >     list_field = ['a','b','c']
>
> >     form = SQLFORM.factory(
> >         Field('a','boolean'),
> >         Field('b','boolean'),
> >         Field('c','boolean'))
>
> >     if form.accepts(request.vars,session, keepvalues=True):
>
> >         for field in list_field:
> >             print request.vars[field]
>
> >     return dict(form=form)
>
> > If I check all three field everything works fine, but if one field is
> > unchecked I got a key error when I try to access it.
>
> > It is like the field doesn't exist until it is checked..?? doesn't
> > make any sense to me...


Re: [web2py] Re: LOAD and redirect

2010-08-07 Thread Julius Minka
Massimo,

I am not able to make it work.

Firstly, just little note, my original 
url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ,
'okres':request.vars.okres, 'druh':request.vars.druh})

can not be used because it returns
/app/default/nehnutelnosti.load?okres=1&typ=1&druh=2

so it probably rightly doesn't redirect to the new page.

Secondly, I tried for testing purposes to construct url 'by hand', both
versions:
1. 
http://127.0.0.1:/app/default/nehnutelnosti?okres=1&typ=1&druh=2

2.
/app/default/nehnutelnosti?okres=1&typ=1&druh=2

Form disappears, but that is all what happens after submit.


Form looks following in the page source:
loading...


What else could be the problem with redirection?
Julius



V Štvrtok, 5. august 2010 o 15:23 -0700, mdipierro napísal(a):
> This is the intended behavior.
> for now you can do
> instead of
> 
>redirect(url)
> 
> use
> 
>raise HTTP(303,**{'web2py-component-
> command':'document.location="%s"'%url})
> 
> 
> On Aug 5, 1:17 pm, Julius Minka  wrote:
> > Having something like this
> >
> > {{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}
> >
> > in the layout.html
> > and something like this
> >
> > form=SQLFORM.factory(
> >Field(...),
> >Field(...),
> >Field(...),
> >formstyle='table2cols',submit_button='Vyhľadať')
> > if form.accepts(request.vars, session):
> >   redirect(URL(r=request,
> > f='2action',vars={'typ':typ}))
> >
> > in action controlller.
> >
> > It almost works, but instead of redirection to '2action', it displays
> > 2action page in the space where previously the form was. URL is not
> > changed.
> >
> > Is this expected behaviour?
> > How to correctly do real redirection to 2action page?
> >
> > Julius




[web2py] Re: LOAD and redirect

2010-08-07 Thread mdipierro
Is your problem the presence of the .load?

> url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ, 
> 'okres':request.vars.okres, 'druh':request.vars.druh})
> can not be used because it returns
> /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2

if you you can specify URL(,extension='html')


On Aug 7, 12:13 pm, Julius Minka  wrote:
> Massimo,
>
> I am not able to make it work.
>
> Firstly, just little note, my original
> url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ,
> 'okres':request.vars.okres, 'druh':request.vars.druh})
>
> can not be used because it returns
> /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
>
> so it probably rightly doesn't redirect to the new page.
>
> Secondly, I tried for testing purposes to construct url 'by hand', both
> versions:
> 1.http://127.0.0.1:/app/default/nehnutelnosti?okres=1&typ=1&druh=2
>
> 2.
> /app/default/nehnutelnosti?okres=1&typ=1&druh=2
>
> Form disappears, but that is all what happens after submit.
>
> Form looks following in the page source:
> loading...
>
> What else could be the problem with redirection?
> Julius
>
> V Štvrtok, 5. august 2010 o 15:23 -0700, mdipierro napísal(a):
>
> > This is the intended behavior.
> > for now you can do
> > instead of
>
> >    redirect(url)
>
> > use
>
> >    raise HTTP(303,**{'web2py-component-
> > command':'document.location="%s"'%url})
>
> > On Aug 5, 1:17 pm, Julius Minka  wrote:
> > > Having something like this
>
> > > {{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}
>
> > > in the layout.html
> > > and something like this
>
> > > form=SQLFORM.factory(
> > >        Field(...),
> > >        Field(...),
> > >        Field(...),
> > >        formstyle='table2cols',submit_button='Vyhľadať')
> > > if form.accepts(request.vars, session):
> > >       redirect(URL(r=request,
> > >                 f='2action',vars={'typ':typ}))
>
> > > in action controlller.
>
> > > It almost works, but instead of redirection to '2action', it displays
> > > 2action page in the space where previously the form was. URL is not
> > > changed.
>
> > > Is this expected behaviour?
> > > How to correctly do real redirection to 2action page?
>
> > > Julius


[web2py] Re: simulating inline forms with SQLFORMS

2010-08-07 Thread mdipierro
Please post a screenshot. You may be able so solve this imply with css

On Aug 7, 11:48 am, "david.waldrop"  wrote:
> i dont quite follow.  Here is my code
>
>     mtgdb.define_table(
>     'thoughts',
>     Field('description','text'),
>     Field('author','string'),
>     Field('votes','integer')
>     )
>
>     ideaform = SQLFORM(mtgdb.thoughts, fields=['description'],
> submit_button='Post', formstyle='divs')
>     if ideaform.accepts(request.vars, session):
>         response.flash = 'form accepted'
>     elif ideaform.errors:
>         response.flash = 'form has errors'
>     else:
>         response.flash = 'please fill out the form'
>
> it creates a form that takes up approximately  3" of the avialiabe
> real estate.  Because teh description field is of type text and teh
> "Post" button is underneath it.  What I want is something like this:
>
> +---
> +
> |
> |        POST
> +---
> +
>
> I found a post with custom widgets and something even more complex
> with the formstyle stuff, but have to believe there is a simpler way.
>
> On Aug 7, 12:39 pm, mdipierro  wrote:
>
> > {{if form.errors:}}
> >  error are {{=form.errors}}
> > {{pass}}
> > {{=form.custom.begin}}
> > {{=form.custom.submit}}
> >  
> > {{=form.custom.end}}
>
> > On Aug 7, 11:34 am, "david.waldrop"  wrote:
>
> > > I am having trouble controlling the visual aspects fo a SQLFORM.  More
> > > specifically, I want to enable a text box and a POST button on the top
> > > of the screen and have a lsit display below it.  The list is gonna be
> > > quite large so I do not want the default 2" text box and the button
> > > below it, but rather a single line of input (that can accept any
> > > mnumber of characters) and the POST button right beside it
> > > vertically.  I played around with the formstyles, but there is not
> > > very good examples.  Any suggestion/examples would be appreciated?


Re: [web2py] Sessions

2010-08-07 Thread Alexandre Andrade
I think that to maintain the state, you can store the session in db,
(someone puts a link about it )

If there is a cookie, web2py checks if the session data exists
automatically.



2010/8/6 Bruno Rocha 

> If I understand, he wants to save session values, even the user closes the
> browser and returns after.
>
> if you set e.g one week to the cookie time limit, this will keep the
> reference to the session ID, but I dont think this will automaticaly keep
> the session values. ( what if the server restarts?)
>
> To maintain the state, I guess you have to store the values anywhere, even
> inside the cookie. Then you have to check if the cookie exists Am I
> wrong?
>
>
>
> 2010/8/6 Alexandre Andrade 
>
> You just have to set a time limit to your session/cookie, like a week,
>> month or year.
>>
>> I'm sure massimo answer how to set a diferent time limit to a cookie
>> before.
>>
>>
>>
>> 2010/8/5 Cody 
>>
>>> Hello,
>>>
>>>
>>> I just started using web2py this summer to create a website.
>>>
>>> Currently, I am having an issue with sessions. I am trying to store
>>> information in session variables without having the user login, but
>>> whenever the browser closes and reopens all the session variables are
>>> reset. I am only storing strings and integers, and the code works as
>>> long as the browser does not close.
>>>
>>> Is there anyway to prevent this? Also, how long do sessions last, and
>>> how can I change that?
>>>
>>
>>
>>
>> --
>> Atenciosamente
>>
>> --
>> =
>> Alexandre Andrade
>> Hipercenter.com
>>
>
>
>
> --
>
> http://rochacbruno.com.br
>



-- 
Atenciosamente

-- 
=
Alexandre Andrade
Hipercenter.com


Re: [web2py] Re: LOAD and redirect

2010-08-07 Thread Julius Minka
V Sobota, 7. august 2010 o 10:20 -0700, mdipierro napísal(a):
> Is your problem the presence of the .load?
> 
No, that is not the main problem.

> > url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ, 
> > 'okres':request.vars.okres, 'druh':request.vars.druh})
> > can not be used because it returns
> > /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
> 
> if you you can specify URL(,extension='html')

url=URL(r=request, f='nehnutelnosti', vars={'typ':request.vars.typ,
'okres':request.vars.okres, 'druh':request.vars.druh},extension='html')

not change, result is still
/app/default/nehnutelnosti.load?okres=1&typ=1&druh=2


MAIN problem is the redirect doesn't work:
if form.accepts(request.vars, session):
url="/"+request.application
+"/default/nehnutelnosti.html?okres="+request.vars.okres
+"&typ="+request.vars.typ+"&druh="+request.vars.druh
raise HTTP(303,**{'web2py-component-command':'document.location="%s"'%
url})

Julius



> 
> 
> On Aug 7, 12:13 pm, Julius Minka  wrote:
> > Massimo,
> >
> > I am not able to make it work.
> >
> > Firstly, just little note, my original
> > url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ,
> > 'okres':request.vars.okres, 'druh':request.vars.druh})
> >
> > can not be used because it returns
> > /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
> >
> > so it probably rightly doesn't redirect to the new page.
> >
> > Secondly, I tried for testing purposes to construct url 'by hand', both
> > versions:
> > 1.http://127.0.0.1:/app/default/nehnutelnosti?okres=1&typ=1&druh=2
> >
> > 2.
> > /app/default/nehnutelnosti?okres=1&typ=1&druh=2
> >
> > Form disappears, but that is all what happens after submit.
> >
> > Form looks following in the page source:
> > loading...
> >
> > What else could be the problem with redirection?
> > Julius
> >
> > V Štvrtok, 5. august 2010 o 15:23 -0700, mdipierro napísal(a):
> >
> > > This is the intended behavior.
> > > for now you can do
> > > instead of
> >
> > >redirect(url)
> >
> > > use
> >
> > >raise HTTP(303,**{'web2py-component-
> > > command':'document.location="%s"'%url})
> >
> > > On Aug 5, 1:17 pm, Julius Minka  wrote:
> > > > Having something like this
> >
> > > > {{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}
> >
> > > > in the layout.html
> > > > and something like this
> >
> > > > form=SQLFORM.factory(
> > > >Field(...),
> > > >Field(...),
> > > >Field(...),
> > > >formstyle='table2cols',submit_button='Vyhľadať')
> > > > if form.accepts(request.vars, session):
> > > >   redirect(URL(r=request,
> > > > f='2action',vars={'typ':typ}))
> >
> > > > in action controlller.
> >
> > > > It almost works, but instead of redirection to '2action', it displays
> > > > 2action page in the space where previously the form was. URL is not
> > > > changed.
> >
> > > > Is this expected behaviour?
> > > > How to correctly do real redirection to 2action page?
> >
> > > > Julius




[web2py] Re: simulating inline forms with SQLFORMS

2010-08-07 Thread david.waldrop
it seems i do not have privileges to add files to the thread.

On Aug 7, 1:22 pm, mdipierro  wrote:
> Please post a screenshot. You may be able so solve this imply with css
>
> On Aug 7, 11:48 am, "david.waldrop"  wrote:
>
>
>
> > i dont quite follow.  Here is my code
>
> >     mtgdb.define_table(
> >     'thoughts',
> >     Field('description','text'),
> >     Field('author','string'),
> >     Field('votes','integer')
> >     )
>
> >     ideaform = SQLFORM(mtgdb.thoughts, fields=['description'],
> > submit_button='Post', formstyle='divs')
> >     if ideaform.accepts(request.vars, session):
> >         response.flash = 'form accepted'
> >     elif ideaform.errors:
> >         response.flash = 'form has errors'
> >     else:
> >         response.flash = 'please fill out the form'
>
> > it creates a form that takes up approximately  3" of the avialiabe
> > real estate.  Because teh description field is of type text and teh
> > "Post" button is underneath it.  What I want is something like this:
>
> > +-- 
> > -
> > +
> > |
> > |        POST
> > +-- 
> > -
> > +
>
> > I found a post with custom widgets and something even more complex
> > with the formstyle stuff, but have to believe there is a simpler way.
>
> > On Aug 7, 12:39 pm, mdipierro  wrote:
>
> > > {{if form.errors:}}
> > >  error are {{=form.errors}}
> > > {{pass}}
> > > {{=form.custom.begin}}
> > > {{=form.custom.submit}}
> > >  
> > > {{=form.custom.end}}
>
> > > On Aug 7, 11:34 am, "david.waldrop"  wrote:
>
> > > > I am having trouble controlling the visual aspects fo a SQLFORM.  More
> > > > specifically, I want to enable a text box and a POST button on the top
> > > > of the screen and have a lsit display below it.  The list is gonna be
> > > > quite large so I do not want the default 2" text box and the button
> > > > below it, but rather a single line of input (that can accept any
> > > > mnumber of characters) and the POST button right beside it
> > > > vertically.  I played around with the formstyles, but there is not
> > > > very good examples.  Any suggestion/examples would be appreciated?


[web2py] Re: LOAD and redirect

2010-08-07 Thread mdipierro
There is a problem with URL. Please check trunk and see if it solves
the problem for you:

This works for me

def index():
 return dict()

def test1():
 form=SQLFORM.factory(Field('name'))
 if form.accepts(request.vars,session):
  url = URL('test2',extension='html')
  response.headers['web2py-component-
command']='document.location="%s"' % url
  raise HTTP(303,**response.headers)
  redirect(URL('test2'))
 return dict(form=form)

def test2():
 return dict(h=H1('hello world'))


with default/index.html

{{extend 'layout.html'}}
This is a test
{{=LOAD('default','test1.load',ajax=True)}}


[web2py] Re: Web2py Application Exhibition -- The Winners!

2010-08-07 Thread Christopher Steel
I was thinking about the same as first prize, I will give you the
organizations name, just waiting for us to complete our new Web2py
website ; )

Thanks Again,

Chris

On Aug 6, 10:33 am, NetAdmin  wrote:
> Thanks for the offer to donate to the next Web2py Application
> Exhibition.
>
> You can let me now what you plan to offer, and I'll list you and your
> organization as do donor. If you wish to remain anonymous, let me
> know.
> As always, you can contact me via gmail
>
> Thanks for the offer.
>
> Mr.NetAdmin
>
> On Aug 5, 9:13 am, Christopher Steel  wrote:> Our 
> congratulations to Martin Mulone of Entre Rios, Argentina for his
> > winning Web2py application "Instant Press"!
>
> > You Rocked it Martin!
>
> > and to Thadeus Burgess of Austin, Texas for the well deserved win in
> > recognition of his exemplification of the spirit of open-source.
>
> > In addition a gigantic thank you to Mr.NetAdmin for having the
> > initiative in addition footing the bill for the first mr.netadmin
> > Web2py ApplicationExhibition!, very much appreciated and we hope to
> > see you all at the NovemberExhibitionwhen (if?) it is officially
> > announced.
>
> > Mr. NetAdmin and other interested parties, our organization is
> > interested in offering up some project prize (dollars?) for the next
> > competition so let us know when the date is "on"! Also I wondering if
> > the current Web2py has a sort of natural annual process cycle that we
> > could try and fit into in order to maximize participation.
>
> > Cheers,
>
> > Christopher Steel
>
> > On Aug 4, 9:55 am, NetAdmin  wrote:
>
> > > Hello Web2py Users!
>
> > > After careful consideration of the entire list of entries...
> > > ( actually the only entry )
> > > the winning entry was submitted by Martin Mulone of Entre Rios,
> > > Argentina.
> > > Martin enjoys music, programming in python, soccer and sailing.
>
> > > His entry, Instant-Press, which is a blogging application, can be
> > > found athttp://code.google.com/p/instant-press/
>
> > > Martin takes home the 1st place prize of $100 dollars.
>
> > > Since there were no entries for second place, I chose give Thadeus
> > > Burgess
> > > the second-place award of $50 dollars.
>
> > > Why Thadeus? During the submission period, his offer to help judge
> > > the competition entries, best exemplified the spirit of open-source.
>
> > > Thadeus Burgess is from Austin, Texas and his interests include
> > > Starcraft,
> > > paintballing, AI and robotics, and hanging out with friends and
> > > family.
>
> > > Thadeus is also a contributor to the Web2py book.
>
> > > Thadeus has websites 
> > > athttp://thadeusb.com/andhttp://odyssey.ecrater.com/filter.php?sort=date
>
> > > Congratulations to both of them!
>
> > > Rumor has it, that there will be anotherExhibitionin November 2010
>
> > > Stay tuned for details!
>
> > > Mr.NetAdmin


[web2py] JS question

2010-08-07 Thread Rob
Hi,

In my attempts to learn, I've been redoing the NerdDinner example from
the .NET MVC tutorial with web2py.  But I'm stuck here:
http://nerddinnerbook.s3.amazonaws.com/Part10.htm section "Adding a
jQuery Animation"

Right now my code looks like this:

function AnimateRSVPMessage() {
$("#rsvpmsg").animate({fontSize: "1.5em"},400);
}

function RSVP() {
web2py_component('{{=URL('Register', args=dinner.id)}}', 'rsvpmsg');
AnimateRSVPMessage();
}


{{if IsAuthenticated():}}
{{if IsUserRegistered(dinner):}}
You are registred for this event!
{{else:}}

RSVP for this event
{{pass}}
{{else:}}
{{=A("Login", _href=URL('user/login'))}} to RSVP for this event.
{{pass}}


Is it possible to emulate the .NET's OnSuccess attribute:

<%= Ajax.ActionLink( "RSVP for this event",
   "Register", "RSVP",
   new { id=Model.DinnerID },
   new AjaxOptions { UpdateTargetId="rsvpmsg",
  OnSuccess="AnimateRSVPMessage"}) %>

I'd only like to animate if web2py_component returns 'not None'.
Possible?

Thanks,
Rob


[web2py] Re: JS question

2010-08-07 Thread Martin.Mulone
Your code (javascript) in html need to be between 

On Aug 7, 6:41 pm, Rob  wrote:
> Hi,
>
> In my attempts to learn, I've been redoing the NerdDinner example from
> the .NET MVC tutorial with web2py.  But I'm stuck 
> here:http://nerddinnerbook.s3.amazonaws.com/Part10.htmsection "Adding a
> jQuery Animation"
>
> Right now my code looks like this:
>
> function AnimateRSVPMessage() {
>         $("#rsvpmsg").animate({fontSize: "1.5em"},400);
>
> }
>
> function RSVP() {
>         web2py_component('{{=URL('Register', args=dinner.id)}}', 'rsvpmsg');
>         AnimateRSVPMessage();
>
> }
>
> 
> {{if IsAuthenticated():}}
>         {{if IsUserRegistered(dinner):}}
>                 You are registred for this event!
>         {{else:}}
>         
>                         RSVP for this event
>         {{pass}}
> {{else:}}
>         {{=A("Login", _href=URL('user/login'))}} to RSVP for this event.
> {{pass}}
> 
>
> Is it possible to emulate the .NET's OnSuccess attribute:
>
> <%= Ajax.ActionLink( "RSVP for this event",
>    "Register", "RSVP",
>    new { id=Model.DinnerID },
>    new AjaxOptions { UpdateTargetId="rsvpmsg",
>       OnSuccess="AnimateRSVPMessage"}) %>
>
> I'd only like to animate if web2py_component returns 'not None'.
> Possible?
>
> Thanks,
> Rob


[web2py] Re: JS question

2010-08-07 Thread Rob
I guess I should have included the whole snippet - it does include the
 tags and what I have works fine the way it is...  I'm just
looking for a way to mimic the OnSuccess feature of the .NET function.

Thanks.

On Aug 7, 3:18 pm, "Martin.Mulone"  wrote:
> Your code (javascript) in html need to be between