Re: [web2py] Re: available Databases and Tables empty in 2.0.6

2012-09-03 Thread Anthony
General warning: upgrading the framework does not update any of the 
framework specific files in the application folder, such as appadmin.py, 
appadmin.html, web2py_ajax.html, web2py.js, and the generic views, so when 
you upgrade, you may have to manually copy some of those files if they have 
changed.

Anthony

On Monday, September 3, 2012 1:56:07 AM UTC-4, Annet wrote:


 2.0.1 was never labeled as stable. 


 I know, but the application I created did work after updating to newer 
 versions so I did bother to create it again in a stable version.

 I now created a new application in 2.0.6 an moved all my code to the new 
 application, which solved the problem.


 Kind regards,

 Annet


-- 





[web2py] Re: Buttons not styled the Bootstrap way.

2012-09-03 Thread Annet


 Again, setting formstyle='bootstrap' might take care of that.


I didn't want to repeat myself, I searched the group and read Massimo's 
announcement 
https://groups.google.com/forum/?fromgroups=#!topic/web2py/tmM5VbYcPrQ but 
couldn't find how the apply bootstrap form styles in web2py :-(

Kind regards,

Annet

-- 





Re: [web2py] Re: web2py 2.0.2 is out

2012-09-03 Thread Annet
Hi Alec,

Thanks for providing me with this code.

Also will need to add in proper success ones as well. I'll get to it within 
 a week then send a pull request


I'll look forward to that.


Kind regards,

Annet 

-- 





[web2py] Re: 2.0.6 on GAE - Routing issues and ticket unrecoverable

2012-09-03 Thread Udi Milo
I've reinstalled the distribution and now I do get a ticket when I 
fabricate an error, but when I go to:

http://127.0.0.1:8080/admin/default/ticket/welcome/127.0.0.1.2012-09-03.04-35-34.686f53b3-db23-4cf7-82bb-0af5c0eee05d

I get:

invalid function (default/admin)


Which means that somehow it doesn't know about the admin app in the 
applications folder...
my routes.py is:

routers = dict(

# base router
BASE = dict(
default_application = 'welcome'
),
)


any ideas?

On Sunday, September 2, 2012 8:38:22 PM UTC-7, Massimo Di Pierro wrote:

 Normally admin is disabled in app.yaml although that does not see to be 
 your problem.

 If you get an unrecoverable thicket there should be a log in gae log. 
 Please let us know what you see.

 On Sunday, 2 September 2012 18:11:09 UTC-5, Udi Milo wrote:

 Hi,

 Decided to start fresh a new project with 2.0.6 on GAE.
 downloaded it,
 unzipped,
 created app.yaml,
 created routes.py

 ran it in PyDev and welcome comes out fine.
 I cannot go to admin app for some reason, and every error is 
 ticket unrecoverable.

 Any idea how to debug it or solutions?



-- 





[web2py] Re: Styling forms

2012-09-03 Thread Annet


 Even when you do  SQLFORM(..., formstyle='bootstrap') , the auto 
 generated forms still come out looking very terrible.


On Mac in Safari, Firefox and Chrome they don't look that bad.

However, this code no longer adds a cancel and or reset button to the form:

 
form[0][-1][1].append(INPUT(_type=button,_value=Cancel,_onclick=javascript:history.go(-1);))

form[0][-1][1].append(INPUT(_type=reset,_value=Reset))


Why not?


Kind regards,

Annet


-- 





[web2py] Re: grid - hiding reconds found count

2012-09-03 Thread Mandar Vaze
I understand this is quite old thread - posting so that it may be relevant 
for others ..

While I was using about Version 2.00.0 (2012-07-26 06:06:10) dev  from 
github, instead of *grid[0][2]* I had to use *grid[0][1]*
When I upgraded to Version 2.0.2 (2012-08-30 04:08:18) stable - The above 
code started given me an error list index out of range
Little debugging showed me that now the records found was at *grid[0][0]*

My code given below for reference. (Following code did *not* change 
between the two versions of web2py, except grid[0][]0] which was grid[0][1] 
earlier.)

grid = SQLFORM.grid(somequery, create=False, deletable=False,  
  searchable=False, csv=False, editable=False, details=False
,
  sortable=False, fields=[db.table.field1, db.table.field2])
 
if somequery.count()  0:   
 
  del grid[0][0]  # Delete n records found text


-Mandar

P.S : I understand that I'm using only the SQLFORM portion of SQLGRID 
(details, edit and delete all set to false), but that is a problem to be 
solved another day ...


On Sunday, October 30, 2011 7:51:01 PM UTC+5:30, Anthony wrote:

 You can also get rid of it using server side DOM manipulation:

 del grid[0][2]  # the web2py_counter div is the third component within the 
 first div of the returned grid object

 Anthony

 On Sunday, October 30, 2011 6:00:12 AM UTC-4, peter wrote:

 I am hoping that the developers of SQLFORM.grid will add an option to 
 hide the 'nn records found' message. In fact I do not think it should 
 appear at all when there is no search in place. I have discovered a 
 neat way of hiding this message 
 Put in your layout.html (or more locally if you wish) 
 style 
 .web2py_counter { display:none} 
 /style 

 Put it just before {{include}} 
 Unfortunately it leaves a gap, but it is much better way of getting 
 rid of the message than editing gluon. 

 Peter



-- 





[web2py] type='date' in form type='text'

2012-09-03 Thread Annet
In a table definition I have:

Field('birthday',type='date',requires=IS_EMPTY_OR(IS_DATE(format='%Y-%m-%d')),represent
 
= lambda v: v.strftime('%d/%m/%Y') if v else '')

form=SQLFORM.factory(db.person, ...)

renders a form in which the field birthday isn't of type date but of type 
text, as a result this doesn't work:

jQuery( .date ).datepicker({dateFormat: 'dd-mm-yy'});


Kind regards,

Annet.

-- 





[web2py] Re: Styling forms

2012-09-03 Thread Anthony


 However, this code no longer adds a cancel and or reset button to the form:

  

 form[0][-1][1].append(INPUT(_type=button,_value=Cancel,_onclick=javascript:history.go(-1);))

 form[0][-1][1].append(INPUT(_type=reset,_value=Reset))


 Why not?


The structure of the bootstrap form is different from the other web2py 
forms, so your subscripting doesn't refer to the same element any more. You 
might be better off using the .element() method rather than subscripting:

form.element('input[type=submit]').parent.extend([INPUT(...), INPUT(...)])

or using the new replace functionality:

form.element('input[type=submit]',
replace=lambda button: CAT(button, INPUT(...), INPUT(...)))

Those should work with any formstyle.

Anthony

-- 





[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Anthony


 renders a form in which the field birthday isn't of type date but of type 
 text, as a result this doesn't work:

 jQuery( .date ).datepicker({dateFormat: 'dd-mm-yy'});


For date fields, the type should be text -- the class is what gets 
set to date. In any case, the jQuery selector used above selects based on 
the class, not the type. If it isn't working, there's probably some other 
problem with the Javascript.

Anthony 

-- 





[web2py] Re: grid - hiding reconds found count

2012-09-03 Thread Anthony
Actually, to make the code more clear and to avoid issues with changing 
subscripts, it's generally best to use the .elements() and .element() 
methods rather than subscripting. In the past, however, this didn't work if 
you needed to replace or remove an element, but now you can do that as 
well. In this case, you can do:

grid.element('.web2py_counter', replace=None)

Anthony

On Monday, September 3, 2012 4:08:54 AM UTC-4, Mandar Vaze wrote:

 I understand this is quite old thread - posting so that it may be relevant 
 for others ..

 While I was using about Version 2.00.0 (2012-07-26 06:06:10) dev  from 
 github, instead of *grid[0][2]* I had to use *grid[0][1]*
 When I upgraded to Version 2.0.2 (2012-08-30 04:08:18) stable - The 
 above code started given me an error list index out of range
 Little debugging showed me that now the records found was at *grid[0][0]
 *

 My code given below for reference. (Following code did *not* change 
 between the two versions of web2py, except grid[0][]0] which was grid[0][1] 
 earlier.)

 grid = SQLFORM.grid(somequery, create=False, deletable=False,  
   searchable=False, csv=False, editable=False, details=
 False,
   sortable=False, fields=[db.table.field1, db.table.field2
 ])  
 if somequery.count()  0: 

   del grid[0][0]  # Delete n records found text


 -Mandar

 P.S : I understand that I'm using only the SQLFORM portion of SQLGRID 
 (details, edit and delete all set to false), but that is a problem to be 
 solved another day ...


 On Sunday, October 30, 2011 7:51:01 PM UTC+5:30, Anthony wrote:

 You can also get rid of it using server side DOM manipulation:

 del grid[0][2]  # the web2py_counter div is the third component within 
 the first div of the returned grid object

 Anthony

 On Sunday, October 30, 2011 6:00:12 AM UTC-4, peter wrote:

 I am hoping that the developers of SQLFORM.grid will add an option to 
 hide the 'nn records found' message. In fact I do not think it should 
 appear at all when there is no search in place. I have discovered a 
 neat way of hiding this message 
 Put in your layout.html (or more locally if you wish) 
 style 
 .web2py_counter { display:none} 
 /style 

 Put it just before {{include}} 
 Unfortunately it leaves a gap, but it is much better way of getting 
 rid of the message than editing gluon. 

 Peter



-- 





[web2py] tag counting

2012-09-03 Thread andrej burja
with this statement i get list of all the tags 
tags = db().select(db.t_tag.f_name,distinct=True)
t_tag has only reference - value
what is the fastest way to count number of appearances for every tag
i would like to dipslay 
tag (number of objects wit that tag)

andrej

-- 





[web2py] internal error crash with newest 2.0.6 and old 1.99.2

2012-09-03 Thread lucas
i have been having a problem with users logging in or registering.  web2py 
seems to crash on some level and returns an internal error after the user 
hits submit upon registering or logging in.  i was initially getting the 
error on my web2py version installed of 1.99.2, so i updated to the latest 
of 2.0.6, but i am still getting the crash.  i am running postgresql 9.1 on 
the backend and centos 6 on the os.

i am able to reproduce it.  it doesn't seem to make a lot of sense to me, 
but it seems to be in the DAL database side of things.  i got the traceback 
of:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.

Traceback (most recent call last):
  File /opt/web-apps/web2py/gluon/main.py, line 562, in wsgibase
session._try_store_on_disk(request, response)
  File /opt/web-apps/web2py/gluon/globals.py, line 683, in _try_store_on_disk
cPickle.dump(dict(self), response.session_file)
  File /usr/lib/python2.6/copy_reg.py, line 74, in _reduce_ex
getstate = self.__getstate__
  File /opt/web-apps/web2py/gluon/dal.py, line 7287, in __getattr__
self.__allocate()
  File /opt/web-apps/web2py/gluon/dal.py, line 7280, in __allocate
self._record = self._table[int(self)]
  File /opt/web-apps/web2py/gluon/dal.py, line 7565, in __getitem__
return self._db(self._id == key).select(limitby=(0,1)).first()
  File /opt/web-apps/web2py/gluon/dal.py, line 8697, in select
return adapter.select(self.query,fields,attributes)
  File /opt/web-apps/web2py/gluon/dal.py, line 1577, in select
return self._select_aux(sql,fields,attributes)
  File /opt/web-apps/web2py/gluon/dal.py, line 1550, in _select_aux
self.execute(sql)
  File /opt/web-apps/web2py/gluon/dal.py, line 1653, in execute
return self.log_execute(*a, **b)
  File /opt/web-apps/web2py/gluon/dal.py, line 1647, in log_execute
ret = self.cursor.execute(*a, **b)
InterfaceError: cursor already closed

-- 





[web2py] Re: web2py 2.0.6 and JqueryUI

2012-09-03 Thread Annet
I am having an issue with jQueryUI auto complete in web2py 1.99.x it worked 
well in web2py 2.0.x it no longer calculates the position of the list 
correctly:

ul class=ui-autocomplete ui-menu ui-widget ui-widget-content 
ui-corner-all role=listbox aria-activedescendant=ui-active-menuitem 
style=z-index: 1; top: 0px; left: 0px; display: block;

In 1.99.x:

ul class=ui-autocomplete ui-menu ui-widget ui-widget-content 
ui-corner-all role=listbox aria-activedescendant=ui-active-menuitem 
style=z-index: 1; top: 260.583px; left: 264.467px; display: block; width: 
196.167px;

top, left and width are not set properly in 2.0.x

I am using the same jQueryUI files in both applications and also the link 
and script statements are identical, what's causing this behaviour?


Kind regards,

Annet

-- 





Re: [web2py] Re: grid - hiding reconds found count

2012-09-03 Thread Mandar Vaze / मंदार वझे
Yes. Works !!
This is great - much cleaner solution.

Thanks Anthony

-Mandar

On Mon, Sep 3, 2012 at 2:05 PM, Anthony abasta...@gmail.com wrote:

 Actually, to make the code more clear and to avoid issues with changing
 subscripts, it's generally best to use the .elements() and .element()
 methods rather than subscripting. In the past, however, this didn't work if
 you needed to replace or remove an element, but now you can do that as
 well. In this case, you can do:

 grid.element('.web2py_counter', replace=None)

 Anthony

 On Monday, September 3, 2012 4:08:54 AM UTC-4, Mandar Vaze wrote:

 I understand this is quite old thread - posting so that it may be
 relevant for others ..

 While I was using about Version 2.00.0 (2012-07-26 06:06:10) dev  from
 github, instead of *grid[0][2]* I had to use *grid[0][1]*
 When I upgraded to Version 2.0.2 (2012-08-30 04:08:18) stable - The
 above code started given me an error list index out of range
 Little debugging showed me that now the records found was at *
 grid[0][0]*

 My code given below for reference. (Following code did *not* change
 between the two versions of web2py, except grid[0][]0] which was grid[0][1]
 earlier.)

 grid = SQLFORM.grid(somequery, create=False, deletable=False,
   searchable=False, csv=False, editable=False, details=
 False,
   sortable=False, fields=[db.table.field1, db.table.
 field2])
 if somequery.count()  0:

   del grid[0][0]  # Delete n records found text


 -Mandar

 P.S : I understand that I'm using only the SQLFORM portion of SQLGRID
 (details, edit and delete all set to false), but that is a problem to be
 solved another day ...


 On Sunday, October 30, 2011 7:51:01 PM UTC+5:30, Anthony wrote:

 You can also get rid of it using server side DOM manipulation:

 del grid[0][2]  # the web2py_counter div is the third component within
 the first div of the returned grid object

 Anthony

 On Sunday, October 30, 2011 6:00:12 AM UTC-4, peter wrote:

 I am hoping that the developers of SQLFORM.grid will add an option to
 hide the 'nn records found' message. In fact I do not think it should
 appear at all when there is no search in place. I have discovered a
 neat way of hiding this message
 Put in your layout.html (or more locally if you wish)
 style
 .web2py_counter { display:none}
 /style

 Put it just before {{include}}
 Unfortunately it leaves a gap, but it is much better way of getting
 rid of the message than editing gluon.

 Peter

  --





-- 





[web2py] Re: tag counting

2012-09-03 Thread villas
Hi Andrej

This is something I've also struggled with in all kinds of ways and I'd be 
interested in any other replies.  

Here is a way I found to count the frequency of a single integer tag.  

rows=db().select(db.mytable.tag)
from collections import defaultdict
d = defaultdict(int)
for r in rows:
d[r.tag] += 1
print d

Here is a way of counting the frequency of a list:integer:

rows=db().select(db.mytable.cat).as_list()
res = []
for r in rows:
for i in r.itervalues():
if i: res.extend(i)

from collections import defaultdict
d = defaultdict(int)
for r in sorted(res):
d[r] += 1

print d


Once you have a dict of  {id:frequency}  I found the rest is easy.  
However,  I also feel sure there must be an easier way than I have found 
above.

Regards, D

-- 





[web2py] Re: web2py 2.0.2 is out

2012-09-03 Thread Martín Miranda
+1 ;) Excelent! 

 I personally want to thank the major contributors to this release (in 
 alphabetic order)
 Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg, Jonathan, 
 Marc, Mariano, Marin, Martin, Mark, Michael, Michele, Niphlod, Patrick, 
 Vladyslav, 
 They spend many nights testing, coding, debugging at a very fast pace.

 Many many people have contributed.

 If your contribution has not been properly acknowledged please let us know 
 ASAP. It is probably an oversight.


 Massimo


 Detailed changelog
 ===

 ## 2.00.2

 ### DAL Improvements

 - Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda 
 table:), thanks Jonathan
 - db(...).select(cacheable=True) make select 30% faster
 - db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x faster
 - db(...).count(cache=(cache.ram,3600)) now supported
 - MongoDB support in DAL (experimental), thanks Mark Breedveld
 - geodal and spatialite, thanks Denes and Fran (experimental)
 - db.mytable._before_insert, _after_insert, _before_update, _after_update, 
 _before_delete. _after_delete (list of callbacks)
 - db(...).update_naive(...) same as update but ignores 
 table._before_update and table._after_update
 - DAL BIGINT support and DAL(...,bigint_id=True)
 - IS_IN_DB(..., distinct=True)
 - new syntax: db.mytable.insert(myuploadfield=open()), thank you 
 Iceberg
 - db(...).select(db.mytable.myfield.count(distinct=True))
 - db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id))
 - db.mytable.myfield.filter_in, filter_out
 - db.mytable._enable_record_versioning(db) adds versioning to this table
 - teradata adapter, thanks Andrew Willimott
 - experimental Sybase Adapter
 - added db.table.field.avg()
 - Support for Google App Engine projections, thanks Christian
 - Field(... 'upload', default=path) now accepts a path to a local file as 
 default value, if user does not upload a file. Relative path looks inside 
 current application folder, thanks Marin
 - executesql(...,fields=,columns=) allows parsing of results in Rows, 
 thanks Anthony

 ### Auth improvements

 - auth.enable_record_versioning(db)  adds full versioning to all tables
 - @auth.requires_login(otherwise=URL(...))
 - auth supports salt and compatible with third party data, thanks Dave 
 Stoll
 - CRYPT now defaults to pbkdf2(1000,20,sha1)
 - Built-in wiki with menu, tags, search, media, permissions. def index: 
 return auth.wiki()
 - auth.settings.everybody_group_id
 - allow storage of uploads on any PyFileSystem (including amazon)

 ### Form improvements

 - FORM.confirm('Are you sure?',{'Back':URL(...)})
 - SQLFORM.smartdictform(dict)
 - form.add_button(value,link)
 - SQLFORM.grid(groupby='...')
 - fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
 - more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, 
 csv, ...)

 ### Admin improvements

 - new admin pages: manage_students, bulk_regsiter, and progress reports
 - increased security in admin against CSRF
 - experimental Git integration
 - experimental OpenShift deployment
 - multi-language pluralization engine 
 - ace text web editor in admin
 - Ukrainian translations, thanks Vladyslav Kozlovskyy
 - Romanian translation for welcome, thanks ionel
 - support for mercurial 2.6, thanks Vlad

 ### Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim)

 - web2py.py -K myapp -X starts the myapp scheduler alongside the webserver
 - tasks are marked EXPIRED (if stop_time passed)
 - functions with no result don't end up in scheduler_run
 - more options: web2py.py -E -b -L
 - scheduler can now handle 10k tasks with 20 concurrent workers and with 
 no issues
 - new params:
 tasks can be found in the environment (no need to define the tasks 
 parameter)
 max_empty_runs kills the workers automatically if no new tasks are 
 found in queue (nice for spikes of processing power)
 discard_results to completely discard the results (if you don't need 
 the output of the task)
 utc_time enables datetime calculations with UTC time
 - scheduler_task changes:
 task_name is no longer required (filled automatically with 
 function_name if found empty)
 uuid makes easy to coordinate scheduler_task maintenance (filled 
 automatically if not provided)
 stop_time has no default (previously was today+1)
 retry_failed to requeue automatically failed tasks
 sync_output refreshes automatically the output (nice to report 
 percentages)
 - workers can be:
 DISABLED (put to sleep and do nothing if not sending the heartbeat 
 every 30 seconds)
 TERMINATE (complete the current task and then die)
 KILL (kill ASAP)

 ### Other Improvements 

 - gluon/contrib/webclient.py makes it easy to create functional tests for 
 app
 - DIV(..).elements(...replace=...), thanks Anthony
 - new layout based on Twitter Bootstrap
 - New generic views: generic.ics (Mac Mail Calendar) and generic.map 
 (Google Maps)
 - request.args(0,default=0, 

[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Annet
Hi Anthony,

Thanks for your reply.

If it isn't working, there's probably some other problem with the 
 Javascript.


class=input-xlarge


appadmin doesn't have this problem:

input type=text value= name=birthday id=person_birthday 
class=date

select name=title id=person_title class=generic-widget/select


 I guess it's the bootstrap formstyle that's causing the problem it sets 
all class attributes to 'input-xlarge'

input type=text value= name=birthday id=no_table_birthday 
class=input-xlarge

select id=no_table_label class=input-xlarge name=label


Kind regards,

Annet

-- 





Re: [web2py] Re: How to use the new cache-options with SQLFORM.grid?

2012-09-03 Thread Johann Spies
On 31 August 2012 13:07, Anthony abasta...@gmail.com wrote:

 FYI, grid now sets cacheable=True when doing selects:
 http://code.google.com/p/web2py/source/detail?r=6596fb84ed0fb49fa19879f80de5fb30ee4d0403.
 Still no caching option, though (I guess you can cache the output of the
 grid itself, though, which is probably better because it avoids all the
 processing of the grid function).


 Thanks!

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 





[web2py] .count(cache=(cache.ram,3600)) - problem

2012-09-03 Thread Johann Spies
In certain circumstances where I cannot exactly determine what is causing
this, using this recent addition causes the psycopg2-driver to complain:

One example:

 (db.akb_auth_sa_univ_link.year == item.year)).count(cache=(cache.ram,3600))

causes


InternalError: current transaction is aborted, commands ignored until
end of transaction block


changing the code to count() as it was previously, solved the problem.

As I said the problem show up from time to time.  It seems when there are
more complicated queries or more data involved.

Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 





[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Anthony


  I guess it's the bootstrap formstyle that's causing the problem it sets 
 all class attributes to 'input-xlarge'


Good catch. We should probably fix that.

Anthony 

-- 





[web2py] PythonAnywhere, upgrading to latest Web2Py?

2012-09-03 Thread Hansel Dunlop
Hi all, 

One of the PythonAnywhere developers here. 

We are planning on updating our default version of Web2Py from 1.99.7 to 
the latest 2.02. This would only be for new installs. Since it is a jump in 
the major version number we were wondering if there was anything we should 
know? How is the backwards compatibility? Will people require any code 
changes if we start automating upgrades of existing sites? Any other things 
that could cause problems?

Sorry for the vague question. It is one of those cases where we don't know 
what we don't know, if you know what I mean :-)

Kind regards 

Hansel Dunlop
  

-- 





Re: [web2py] Code syntax highlighting in a post

2012-09-03 Thread Johann Spies
On 2 September 2012 22:55, shartha m.mirghorb...@gmail.com wrote:

 Could one of the administrators please turn on the code syntax
 highlighting as explained in this 
 linkhttp://support.google.com/groups/bin/answer.py?hl=enanswer=1050526
 ?
 Or if that's been done already, could somebody please explain how that can
 be done?


I think it is only available when you use
https://groups.google.com/forum/?fromgroups#!forum/web2py

I normally read the posts in my gmail account.  When I need to post
highighted code, I use the google-groups interface directly.

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 





Re: [web2py] Re: Buttons not styled the Bootstrap way.

2012-09-03 Thread Johann Spies
On 3 September 2012 08:05, Annet anneve...@googlemail.com wrote:


 Again, setting formstyle='bootstrap' might take care of that.


 I didn't want to repeat myself, I searched the group and read Massimo's
 announcement
 https://groups.google.com/forum/?fromgroups=#!topic/web2py/tmM5VbYcPrQbut 
 couldn't find how the apply bootstrap form styles in web2py :-(
  vorm = SQLFORM.factory(Field('journal_title'),formstyle='bootstrap')


 form = SQLFORM.factory(Field('journal_title'),formstyle='bootstrap')

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 





[web2py] Re: Code syntax highlighting in a post

2012-09-03 Thread Anthony
It is turned on.

Note, it only works in the web interface, but not when viewing on a mobile 
phone or tablet (unless you request the desktop app).

Anthony

On Sunday, September 2, 2012 4:55:44 PM UTC-4, shartha wrote:

 Could one of the administrators please turn on the code syntax 
 highlighting as explained in this 
 linkhttp://support.google.com/groups/bin/answer.py?hl=enanswer=1050526
 ?
 Or if that's been done already, could somebody please explain how that can 
 be done? 

 Thanks!


-- 





[web2py] Re: Scaling Web2py

2012-09-03 Thread howesc
yes, i manage a (seemingly to me) large application.  30-40 request per 
second average sustained 24 hours a day.  that app is the data access API 
for an iOS app plus an accompanying website.  some thoughts:
 - we use google app engine.  on the up side it serves all my requests, on 
the downside we pay money in hosting to make up for bad programming.
 - we are using a class based models approach.   i'm interested in trying 
the new lazy tables feature and perhaps switching to that.
 - we use memcache when possible. (it is possible to use it more we need to 
work on that)
 - we are starting to use the google edge cache for pages/API responses 
that are not user specific.  we can use more of this, but i believe those 
requests served by the cache are counted in our request numbers.
 - some % of our API requests return somewhat static JSON - in this case we 
generate the JSON when it changes (a few times a week), upload to amazon 
S3, and then wrote a piece of router middleware to redirect the request 
before web2py even is invokedso we have some creative things in there 
to have high request numbers that are not quite hitting web2py itself.

i'm happy to talk more about specific experiences if there are more 
specific questions.

On Saturday, September 1, 2012 11:58:46 AM UTC-7, David Marko wrote:

 Hi all, i'm also curious on this. Can howesc share his experience ... Or 
 others ?  We are planing project for estimated 1mil views per working hours 
 (in 12 hours in day). I know that there are many aspects but generaly would 
 be encouraging to hear real life data with architecture info. How many 
 server do you use, do you use some round robin proxy etc.  

-- 





Re: [web2py] Using GAE Launcher - a beginner's question

2012-09-03 Thread howesc
if it was our app.example.yaml file from the latest release then please 
open a ticket to have us update the example file to work with the latest 
GAE launcher.

thanks!

cfh

On Sunday, September 2, 2012 10:20:04 PM UTC-7, Andy W wrote:

 That fixed it - many thanks!

 On Sunday, September 2, 2012 4:11:24 PM UTC+4, Jan-Karel Visser wrote:

 put a # in front off - datastore_admin in the yaml and off you go :)


 2012/9/2 Andy W andyweb...@gmail.com

 I am experimenting with web2py and GAE. web2py is running fine on my 
 local machine (Windows 7) but I cannot get even the default Welcome app to 
 run on the GAE SDK.

 Here are the detailed steps I have taken:
 1. Downloaded web2py (v 2.0.6) and unpacked to E:\web2py
 2. Run locally with the web2py rocket server - see the Welcome app as 
 expected
 3. Copied routes.example.py to routes.py. On line 8, set 
 default_application = 'welcome'
 4. Copied app.example.yaml to app.yaml.  On line 6, changed application 
 name to 'welcome'
 5. Run the Windows GUI version of Google App Engine SDK (release 1.7.1). 
 Used File  Add Existing Application, setting the application path to 
 E:\web2py
 6. Run the application and pressed the 'Browse' button

 The application fails with the warning No selected projects are running 
 so we have nothing to Browse

 The log file reads:
   File C:\Program Files 
 (x86)\Google\google_appengine\google\appengine\api\appinfo_includes.py, 
 line 222, in _ConvertBuiltinsToIncludes
 yaml_path = builtins.get_yaml_path(builtin_name, runtime)
   File C:\Program Files 
 (x86)\Google\google_appengine\google\appengine\ext\builtins\__init__.py, 
 line 120, in get_yaml_path
 builtin_name, ', '.join(sorted(available_builtins
 google.appengine.ext.builtins.InvalidBuiltinName: datastore_admin is not 
 the name of a valid builtin.
 Available handlers are: admin_redirect, appstats, default, deferred, 
 django_wsgi, remote_api
 2012-09-02 14:45:06 (Process exited with code 1)

 Any pointers to what I am missing would be much appreciated!

  -- 
  
  
  




-- 





[web2py] Re: Classes in markmin

2012-09-03 Thread Massimo Di Pierro
I am not sure I understand why would you want to encapsulate a ul / in a 
div/. It seems redundant to me.

Notice markmin has been greatly improved although the docs have not been 
updated. Here are some more features:

http://web2py.googlecode.com/hg/gluon/contrib/markmin/markmin.html

Anyway

On Sunday, 2 September 2012 23:46:51 UTC-5, viniciusban wrote:

 I'm in charge to find a good solution to document some projects and I 
 faced markdown, reST and markmin. 

 I found this thread from about 1 year ago: 
 https://groups.google.com/forum/?fromgroups=#!topic/web2py/driLl6I8K64 

 Comparing reST with markmin, I observed reST creates div to 
 encapsulate lists, sections, etc. We can benefit of this approach to 
 customize presentations with CSS. 

 What does markmin do about it? 

 I know Web2py book app is written to support markmin and to publish the 
 book on the web. But do we have some sphinx-like tool to generate static 
 html files from markmin? 

 -- 
 Vinicius Assef 


-- 





[web2py] Re: need a simple wiki...

2012-09-03 Thread Massimo Di Pierro


On Monday, 3 September 2012 00:51:47 UTC-5, Andrew W wrote:

 Hi Massimo,

 Some questions on auth.wiki,  in anticipation of some details in the book.
 Have you finalised the syntax for adding components ?


I think we can keep @{component:url}
 

 How do I embed media eg images?  Do I follow the markmin reference doc, or 
 is it a combo of the two:  I've added the media to the page
 [[some image @5/slug.jpg right 200px]] or [[some image 
 http://www.web2py.com/examples/static/web2py logo.png right 200px]] or 
 just @5/slug.jpg.


The syntax is @/app/controller/function/args maps into 
URL('app','controller','function',args=args) and you can omit 
app/controller and args. Thus simply @///function. This can be used as an 
URL anywhere in the markmin source. If it is the URL of an image or a video 
or an audio, file, markmin will embed the content sing the appropriate tag 
(img, video, audio).


 I'm updating pages but they don't get refreshed - is there caching on by 
 default ?  This might have been causing my earlier issue as I'm not seeing 
 an updated page.


How do you update them? The html is cached in db but should be updated when 
you use the edit action.
 

 Does you have to be in default/index to call auth.wiki() ?


No. But it should be exposed by one single web2py action.
 

 Do users have to log in to see the wiki pages ?  The login screen comes up 
 by default.  I would like a wik page to come up by default.


No, unless you set permissions=True. The caveat is that when you first 
start the app there are no wiki pages so nothing to see. Web2py assumes you 
must create some pages and therefore requires login to do that. After you 
create some pages (or only one), then they can be accessed publicly (unless 
permissions=True and you set restrictions on individual pages).

I will soon document this in the book a little better.
 


 Thanks

 Andrew W


 wiki media are embedded with @5/slug.jpg where 5 is the id of the 
 media file. 

 You can embed components with @{component:controller/function/args) - 
 LOAD('controller','function',args=args)
 (not sure about this syntax, may still change it)



-- 





[web2py] Re: internal error crash with newest 2.0.6 and old 1.99.2

2012-09-03 Thread Massimo Di Pierro
Can you show us the action that causes the problem? I suspect you have 
something like this:

def youraction()
   
   try:
  do something with db
   except:
  do something else
   ...

For some reason do something with db fails and closes the db cursor. It 
should be

def youraction()
   
   try:
  do something with db
   except:
  db.rollback()
  do something else
   ...






On Monday, 3 September 2012 04:25:31 UTC-5, lucas wrote:

 i have been having a problem with users logging in or registering.  web2py 
 seems to crash on some level and returns an internal error after the user 
 hits submit upon registering or logging in.  i was initially getting the 
 error on my web2py version installed of 1.99.2, so i updated to the latest 
 of 2.0.6, but i am still getting the crash.  i am running postgresql 9.1 on 
 the backend and centos 6 on the os.

 i am able to reproduce it.  it doesn't seem to make a lot of sense to me, 
 but it seems to be in the DAL database side of things.  i got the traceback 
 of:

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.
 17.
 18.
 19.
 20.
 21.
 22.
 23.
 24.
 25.

 Traceback (most recent call last):
   File /opt/web-apps/web2py/gluon/main.py, line 562, in wsgibase
 session._try_store_on_disk(request, response)
   File /opt/web-apps/web2py/gluon/globals.py, line 683, in 
 _try_store_on_disk
 cPickle.dump(dict(self), response.session_file)
   File /usr/lib/python2.6/copy_reg.py, line 74, in _reduce_ex
 getstate = self.__getstate__
   File /opt/web-apps/web2py/gluon/dal.py, line 7287, in __getattr__
 self.__allocate()
   File /opt/web-apps/web2py/gluon/dal.py, line 7280, in __allocate
 self._record = self._table[int(self)]
   File /opt/web-apps/web2py/gluon/dal.py, line 7565, in __getitem__
 return self._db(self._id == key).select(limitby=(0,1)).first()
   File /opt/web-apps/web2py/gluon/dal.py, line 8697, in select
 return adapter.select(self.query,fields,attributes)
   File /opt/web-apps/web2py/gluon/dal.py, line 1577, in select
 return self._select_aux(sql,fields,attributes)
   File /opt/web-apps/web2py/gluon/dal.py, line 1550, in _select_aux
 self.execute(sql)
   File /opt/web-apps/web2py/gluon/dal.py, line 1653, in execute
 return self.log_execute(*a, **b)
   File /opt/web-apps/web2py/gluon/dal.py, line 1647, in log_execute
 ret = self.cursor.execute(*a, **b)
 InterfaceError: cursor already closed



-- 





[web2py] Re: PythonAnywhere, upgrading to latest Web2Py?

2012-09-03 Thread Massimo Di Pierro
Thank you Hansel,

Do not use 2.0.2 because it has lots of issues. They have been fixed in 
2.0.6 and I strongly suggest you us 2.0.6. It should not cause any 
problems. We will soon be releasing 2.1 with yet more speed improvements 
and features. You may want to week one more week.

Massimo

On Monday, 3 September 2012 06:32:24 UTC-5, Hansel Dunlop wrote:

 Hi all, 

 One of the PythonAnywhere developers here. 

 We are planning on updating our default version of Web2Py from 1.99.7 to 
 the latest 2.02. This would only be for new installs. Since it is a jump in 
 the major version number we were wondering if there was anything we should 
 know? How is the backwards compatibility? Will people require any code 
 changes if we start automating upgrades of existing sites? Any other things 
 that could cause problems?

 Sorry for the vague question. It is one of those cases where we don't know 
 what we don't know, if you know what I mean :-)

 Kind regards 

 Hansel Dunlop
   


-- 





[web2py] Re: .count(cache=(cache.ram,3600)) - problem

2012-09-03 Thread Massimo Di Pierro
Can you help us? In dal.py there is a log_execute function. Can you add a 
print command in there to see what command is sent to the driver?

On Monday, 3 September 2012 07:24:36 UTC-5, Johann Spies wrote:

 In certain circumstances where I cannot exactly determine what is causing 
 this, using this recent addition causes the psycopg2-driver to complain:

 One example:

  (db.akb_auth_sa_univ_link.year == item.year)).count(cache=(cache.ram,3600))

 causes


 InternalError: current transaction is aborted, commands ignored until end of 
 transaction block


 changing the code to count() as it was previously, solved the problem.

 As I said the problem show up from time to time.  It seems when there are 
 more complicated queries or more data involved.

 Regards
 Johann

 -- 
 Because experiencing your loyal love is better than life itself, 
 my lips will praise you.  (Psalm 63:3)



-- 





[web2py] Re: Cannot login via web2py mobile admin (V 2.0.6)

2012-09-03 Thread Massimo Di Pierro
Ouch! Can can fix this.

On Monday, 3 September 2012 07:27:33 UTC-5, Gerd wrote:

 Hi!

 First i want to thank Massimo and all the other contributors for their 
 great work!

 I've found an issue:
 When trying to login to the admin interface via an iPhone the web2py 
 mobile admin shows up, and there the Login-Button is not a button but a 
 text-field, see the screenshot

 regards
 Gerd




-- 





[web2py] Re: Cannot login via web2py mobile admin (V 2.0.6)

2012-09-03 Thread Massimo Di Pierro
Please check trunk. I think the problem is that admin requires https.

On Monday, 3 September 2012 08:44:22 UTC-5, Massimo Di Pierro wrote:

 Ouch! Can can fix this.

 On Monday, 3 September 2012 07:27:33 UTC-5, Gerd wrote:

 Hi!

 First i want to thank Massimo and all the other contributors for their 
 great work!

 I've found an issue:
 When trying to login to the admin interface via an iPhone the web2py 
 mobile admin shows up, and there the Login-Button is not a button but a 
 text-field, see the screenshot

 regards
 Gerd




-- 





[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Massimo Di Pierro
How?

On Monday, 3 September 2012 07:41:01 UTC-5, Anthony wrote:

  I guess it's the bootstrap formstyle that's causing the problem it sets 
 all class attributes to 'input-xlarge'


 Good catch. We should probably fix that.

 Anthony 


-- 





[web2py] Re: Scaling Web2py

2012-09-03 Thread Massimo Di Pierro
Did you try 2.0.6? Does everything work well for you? Do you notice any 
performance improvements?

On Monday, 3 September 2012 08:07:09 UTC-5, howesc wrote:

 yes, i manage a (seemingly to me) large application.  30-40 request per 
 second average sustained 24 hours a day.  that app is the data access API 
 for an iOS app plus an accompanying website.  some thoughts:
  - we use google app engine.  on the up side it serves all my requests, on 
 the downside we pay money in hosting to make up for bad programming.
  - we are using a class based models approach.   i'm interested in trying 
 the new lazy tables feature and perhaps switching to that.
  - we use memcache when possible. (it is possible to use it more we need 
 to work on that)
  - we are starting to use the google edge cache for pages/API responses 
 that are not user specific.  we can use more of this, but i believe those 
 requests served by the cache are counted in our request numbers.
  - some % of our API requests return somewhat static JSON - in this case 
 we generate the JSON when it changes (a few times a week), upload to amazon 
 S3, and then wrote a piece of router middleware to redirect the request 
 before web2py even is invokedso we have some creative things in there 
 to have high request numbers that are not quite hitting web2py itself.

 i'm happy to talk more about specific experiences if there are more 
 specific questions.

 On Saturday, September 1, 2012 11:58:46 AM UTC-7, David Marko wrote:

 Hi all, i'm also curious on this. Can howesc share his experience ... Or 
 others ?  We are planing project for estimated 1mil views per working hours 
 (in 12 hours in day). I know that there are many aspects but generaly would 
 be encouraging to hear real life data with architecture info. How many 
 server do you use, do you use some round robin proxy etc.  



-- 





[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Anthony
I just sent you a patch.

On Monday, September 3, 2012 9:48:34 AM UTC-4, Massimo Di Pierro wrote:

 How?

 On Monday, 3 September 2012 07:41:01 UTC-5, Anthony wrote:

  I guess it's the bootstrap formstyle that's causing the problem it sets 
 all class attributes to 'input-xlarge'


 Good catch. We should probably fix that.

 Anthony 



-- 





[web2py] Re: web2py 2.0.6 and JqueryUI

2012-09-03 Thread LightDot
When you say that you are using the same jQueryUI files, does this mean the 
same old jQuery version? Version of jQuery bundled with web2py welcome app 
has changed between 1.99.x and 2.0.x, so if you're upgrading your existing 
app in any way, this might be a factor too.

Regards,
Ales

On Monday, September 3, 2012 11:36:23 AM UTC+2, Annet wrote:

 I am having an issue with jQueryUI auto complete in web2py 1.99.x it 
 worked well in web2py 2.0.x it no longer calculates the position of the 
 list correctly:

 ul class=ui-autocomplete ui-menu ui-widget ui-widget-content 
 ui-corner-all role=listbox aria-activedescendant=ui-active-menuitem 
 style=z-index: 1; top: 0px; left: 0px; display: block;

 In 1.99.x:

 ul class=ui-autocomplete ui-menu ui-widget ui-widget-content 
 ui-corner-all role=listbox aria-activedescendant=ui-active-menuitem 
 style=z-index: 1; top: 260.583px; left: 264.467px; display: block; width: 
 196.167px;

 top, left and width are not set properly in 2.0.x

 I am using the same jQueryUI files in both applications and also the link 
 and script statements are identical, what's causing this behaviour?


 Kind regards,

 Annet


-- 





[web2py] bug http.py / mod_wsgi

2012-09-03 Thread Corne Dickens
situation:
apache / mod_wsgi

reproduce:
in routes.py

routes_onerror = [('appname/*','/appname/error/index')]


controllers/error.py
response.status = request.vars.code
return dict()

setting response.status is here to make sure that I keep the same status 
code..

This results in
mod_wsgi (pid=1125): Exception occurred processing WSGI script 
'/var/www/web2py/wsgihandler.py'.
Traceback (most recent call 
last):  
  File /var/www/web2py/gluon/main.py, line 604, in 
wsgibase   
return 
wsgibase(new_environ,responder) 
 

  File /var/www/web2py/gluon/main.py, line 607, in 
wsgibase   
return 
http_response.to(responder) 
 

  File /var/www/web2py/gluon/http.py, line 94, in 
to  
responder(status, 
headers)  
ValueError: status message was not 
supplied 


To avoid this, we can do a few things
first of all, try to cast the status to an int (in the test it's a string 
so it's not matching any item in defined_status)
second, make sure there always is a message supplied (which means 3 digit 
status code, space and than at least 1 character.. The original code where 
there is a space added doesn't work / results in the exception.)

diff:
diff --git a/gluon/http.py b/gluon/http.py
index 69356b8..36fef89 100644
--- a/gluon/http.py
+++ b/gluon/http.py
@@ -55,6 +55,8 @@ try:
 BaseException
 except NameError:
 BaseException = Exception
+
+import re


 class HTTP(BaseException):
@@ -80,10 +82,20 @@ class HTTP(BaseException):
 env = env or {}
 status = self.status
 headers = self.headers
+
+# Cast status to int
+try:
+status = int(status)
+except ValueError:
+pass
+
 if status in defined_status:
 status = '%d %s' % (status, defined_status[status])
-else:
-status = str(status) + ' '
+
+# Make sure we have a status + message (3 ints then space followed 
by anything..)
+if re.match(\d{3} [^ ], status) == None:
+status = str(status) + ' UNKNOWN ERROR'
+
 if not 'Content-Type' in headers:
 headers['Content-Type'] = 'text/html; charset=UTF-8'
 body = self.body



-- 





[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Anthony
Note, this should now be fixed in trunk -- try it if you get a chance.

Anthony

On Monday, September 3, 2012 7:13:09 AM UTC-4, Annet wrote:

 Hi Anthony,

 Thanks for your reply.

 If it isn't working, there's probably some other problem with the 
 Javascript.


 class=input-xlarge


 appadmin doesn't have this problem:

 input type=text value= name=birthday id=person_birthday 
 class=date

 select name=title id=person_title class=generic-widget/select


  I guess it's the bootstrap formstyle that's causing the problem it sets 
 all class attributes to 'input-xlarge'

 input type=text value= name=birthday id=no_table_birthday 
 class=input-xlarge

 select id=no_table_label class=input-xlarge name=label


 Kind regards,

 Annet


-- 





Re: [web2py] Re: 2.0.6 on GAE - Routing issues and ticket unrecoverable

2012-09-03 Thread Jonathan Lundell
On 2 Sep 2012, at 9:48 PM, Udi Milo udim...@gmail.com wrote:
 I've reinstalled the distribution and now I do get a ticket when I fabricate 
 an error, but when I go to:
 
 http://127.0.0.1:8080/admin/default/ticket/welcome/127.0.0.1.2012-09-03.04-35-34.686f53b3-db23-4cf7-82bb-0af5c0eee05d
 
 I get:
 
 invalid function (default/admin)
 
 
 
 Which means that somehow it doesn't know about the admin app in the 
 applications folder...
 my routes.py is:
 
 routers = dict(
 
 # base router
 BASE = dict(
 default_application = 'welcome'
 ),
 )
 
 
 any ideas?

In app.example.yaml, skip_files: by default excludes the examples and admin 
apps. Change 

 (applications/(admin|examples)/.*)|

to

 (applications/examples/.*)|

 
 On Sunday, September 2, 2012 8:38:22 PM UTC-7, Massimo Di Pierro wrote:
 Normally admin is disabled in app.yaml although that does not see to be your 
 problem.
 
 If you get an unrecoverable thicket there should be a log in gae log. Please 
 let us know what you see.
 
 On Sunday, 2 September 2012 18:11:09 UTC-5, Udi Milo wrote:
 Hi,
 
 Decided to start fresh a new project with 2.0.6 on GAE.
 downloaded it,
 unzipped,
 created app.yaml,
 created routes.py
 
 ran it in PyDev and welcome comes out fine.
 I cannot go to admin app for some reason, and every error is ticket 
 unrecoverable.
 
 Any idea how to debug it or solutions?
 
 -- 
  
  
  


-- 





[web2py] Redirect to https (V 2.0.6)

2012-09-03 Thread Gerd
Hi!

Another issues/whishes:
- In the welcome app, is it possible to redirect to https rather then http 
when clicking on the button named Administrative interface

- When creating a new app via the admin interface New simple application, 
i receive following error:
unable to create application test1

Traceback (most recent call last):
  File /home/gniemetz/webapps/web2py/web2py/gluon/admin.py, line 188, in 
app_create
w2p_unpack('welcome.w2p', path)
  File /home/gniemetz/webapps/web2py/web2py/gluon/fileutils.py, line 243, in 
w2p_unpack
fgzipped = gzopen(filename, 'rb')
  File /usr/local/lib/python2.7/gzip.py, line 34, in open
return GzipFile(filename, mode, compresslevel)
  File /usr/local/lib/python2.7/gzip.py, line 89, in __init__
fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: [Errno 2] No such file or directory: 
'/home/gniemetz/webapps/web2py/web2py/welcome.w2p'


My workaraound was to pack the welcome app, name it welcome.w2p and put it 
into the web2py folder

regards
Gerd

-- 





[web2py] Re: Cannot login via web2py mobile admin (V 2.0.6)

2012-09-03 Thread Gerd
I've used https on the iphone

Am Montag, 3. September 2012 15:47:35 UTC+2 schrieb Massimo Di Pierro:

 Please check trunk. I think the problem is that admin requires https.

 On Monday, 3 September 2012 08:44:22 UTC-5, Massimo Di Pierro wrote:

 Ouch! Can can fix this.

 On Monday, 3 September 2012 07:27:33 UTC-5, Gerd wrote:

 Hi!

 First i want to thank Massimo and all the other contributors for their 
 great work!

 I've found an issue:
 When trying to login to the admin interface via an iPhone the web2py 
 mobile admin shows up, and there the Login-Button is not a button but a 
 text-field, see the screenshot

 regards
 Gerd




-- 





[web2py] Re: internal error crash with newest 2.0.6 and old 1.99.2

2012-09-03 Thread lucas
ok, i have tons of db() accesses throughout a few thousand lines of code. 
 thinking out loud,   but since it has to do with session and/or logging in 
and registering, then i can begin with the initial screens wherein the 
cookies or such may be reset and such.  i have a few ideas of where, and in 
those areas i will capture exceptions and rollback as suggested.  what 
exactly is the exception for the db or DAL?  like


try:
  some code
except DBException on e:
  db.rollback()
  return 'db exception: %s' % e

just so that i can at least return more tracking information also.  lucas

-- 





[web2py] Re: Scaling Web2py

2012-09-03 Thread David Marko
Great!! The first set of questions ... some are maybe too private, you see 
...

API for iOS
### does it mean that you dont use views, just endering data to JSON, and 
data representation is done in iOS app?

30-40 request per second average sustained 24 hours a day. 
### have you tried how high (in meaning of req/sec) you can get on GAE? Do 
you have some peaks that are still served well?

we use google app engine.  
### how do you evaluate entire dev process using web2py? Do you have some 
procedure for deployment like develop localy using sqlite, then deploying 
to some GAE demo account, then to production ?? 
### whats your long time experience with GAE in meaning of stability, speed 
etc. ?
### how much data do you store in GAE datastore, is it fast enough?


Thanks!


Dne pondělí, 3. září 2012 15:07:09 UTC+2 howesc napsal(a):

 yes, i manage a (seemingly to me) large application.  30-40 request per 
 second average sustained 24 hours a day.  that app is the data access API 
 for an iOS app plus an accompanying website.  some thoughts:
  - we use google app engine.  on the up side it serves all my requests, on 
 the downside we pay money in hosting to make up for bad programming.
  - we are using a class based models approach.   i'm interested in trying 
 the new lazy tables feature and perhaps switching to that.
  - we use memcache when possible. (it is possible to use it more we need 
 to work on that)
  - we are starting to use the google edge cache for pages/API responses 
 that are not user specific.  we can use more of this, but i believe those 
 requests served by the cache are counted in our request numbers.
  - some % of our API requests return somewhat static JSON - in this case 
 we generate the JSON when it changes (a few times a week), upload to amazon 
 S3, and then wrote a piece of router middleware to redirect the request 
 before web2py even is invokedso we have some creative things in there 
 to have high request numbers that are not quite hitting web2py itself.

 i'm happy to talk more about specific experiences if there are more 
 specific questions.

 On Saturday, September 1, 2012 11:58:46 AM UTC-7, David Marko wrote:

 Hi all, i'm also curious on this. Can howesc share his experience ... Or 
 others ?  We are planing project for estimated 1mil views per working hours 
 (in 12 hours in day). I know that there are many aspects but generaly would 
 be encouraging to hear real life data with architecture info. How many 
 server do you use, do you use some round robin proxy etc.  



-- 





Re: [web2py] Re: Scaling Web2py

2012-09-03 Thread Jonathan Lundell
On 3 Sep 2012, at 7:42 AM, David Marko dma...@tiscali.cz wrote:
 Great!! The first set of questions ... some are maybe too private, you see ...
 
 API for iOS
 ### does it mean that you dont use views, just endering data to JSON, and 
 data representation is done in iOS app?
 
 30-40 request per second average sustained 24 hours a day. 
 ### have you tried how high (in meaning of req/sec) you can get on GAE? Do 
 you have some peaks that are still served well?
 
 we use google app engine.  
 ### how do you evaluate entire dev process using web2py? Do you have some 
 procedure for deployment like develop localy using sqlite, then deploying to 
 some GAE demo account, then to production ?? 

One of the nice things about GAE is that you can deploy a new version without 
making it the default version. Your client just needs to use the appropriate 
version-specific URL to access it.

Also, Google supplies a kind of local simulator, so you can run the app on your 
local machine in a virtual GAE environment, rather than sqlite (though of 
course you could do it that way too, if you wanted).

 ### whats your long time experience with GAE in meaning of stability, speed 
 etc. ?
 ### how much data do you store in GAE datastore, is it fast enough?
 
 
 Thanks!
 
 
 Dne pondělí, 3. září 2012 15:07:09 UTC+2 howesc napsal(a):
 yes, i manage a (seemingly to me) large application.  30-40 request per 
 second average sustained 24 hours a day.  that app is the data access API for 
 an iOS app plus an accompanying website.  some thoughts:
  - we use google app engine.  on the up side it serves all my requests, on 
 the downside we pay money in hosting to make up for bad programming.
  - we are using a class based models approach.   i'm interested in trying the 
 new lazy tables feature and perhaps switching to that.
  - we use memcache when possible. (it is possible to use it more we need to 
 work on that)
  - we are starting to use the google edge cache for pages/API responses that 
 are not user specific.  we can use more of this, but i believe those requests 
 served by the cache are counted in our request numbers.
  - some % of our API requests return somewhat static JSON - in this case we 
 generate the JSON when it changes (a few times a week), upload to amazon S3, 
 and then wrote a piece of router middleware to redirect the request before 
 web2py even is invokedso we have some creative things in there to have 
 high request numbers that are not quite hitting web2py itself.
 
 i'm happy to talk more about specific experiences if there are more specific 
 questions.
 
 On Saturday, September 1, 2012 11:58:46 AM UTC-7, David Marko wrote:
 Hi all, i'm also curious on this. Can howesc share his experience ... Or 
 others ?  We are planing project for estimated 1mil views per working hours 
 (in 12 hours in day). I know that there are many aspects but generaly would 
 be encouraging to hear real life data with architecture info. How many server 
 do you use, do you use some round robin proxy etc. 
 
 


-- 





[web2py] Redirect to https (V 2.0.6)

2012-09-03 Thread Andrew W
In your web2py directory type in touch NEWINSTALL and then restart web2py. 
It recreates the file you need.  It should be there, unless it was deleted.

-- 





Re: [web2py] Classes in markmin

2012-09-03 Thread vinicius...@gmail.com
But is there some tool to generate offline docs, like Sphinx, using 
themes and linking local pages?


That's what I'm looking for.

--
Vinicius Assef


On 09/03/2012 01:54 AM, Bruno Rocha wrote:

There is markmin2pdf and markmin2html on gluon.contrib

https://github.com/web2py/web2py/tree/master/gluon/contrib/markmin

--





--





[web2py] _custom_commit

2012-09-03 Thread Corne Dickens
See 
https://groups.google.com/forum/?fromgroups#!topic/web2py-developers/pSF3WbO2B5o

_custom_commit is commented out right now..
(is this intentionally? And if so, what would be the way to call a custom 
commit now in case your not using DAL?)

-- 





[web2py] Re: _custom_commit

2012-09-03 Thread Anthony
Looks like the old code is commented, but the logic was simply moved to 
dal.BaseAdapter.close_all_instances, so should still work.

Anthony

On Monday, September 3, 2012 11:03:05 AM UTC-4, Corne Dickens wrote:

 See 
 https://groups.google.com/forum/?fromgroups#!topic/web2py-developers/pSF3WbO2B5o

 _custom_commit is commented out right now..
 (is this intentionally? And if so, what would be the way to call a custom 
 commit now in case your not using DAL?)


-- 





[web2py] Re: PythonAnywhere, upgrading to latest Web2Py?

2012-09-03 Thread Hansel Dunlop
Thanks Massimo, 

We definitely heed your advice!

Cheers 

Hansel

On Monday, 3 September 2012 14:41:19 UTC+1, Massimo Di Pierro wrote:

 Thank you Hansel,

 Do not use 2.0.2 because it has lots of issues. They have been fixed in 
 2.0.6 and I strongly suggest you us 2.0.6. It should not cause any 
 problems. We will soon be releasing 2.1 with yet more speed improvements 
 and features. You may want to week one more week.

 Massimo

 On Monday, 3 September 2012 06:32:24 UTC-5, Hansel Dunlop wrote:

 Hi all, 

 One of the PythonAnywhere developers here. 

 We are planning on updating our default version of Web2Py from 1.99.7 to 
 the latest 2.02. This would only be for new installs. Since it is a jump in 
 the major version number we were wondering if there was anything we should 
 know? How is the backwards compatibility? Will people require any code 
 changes if we start automating upgrades of existing sites? Any other things 
 that could cause problems?

 Sorry for the vague question. It is one of those cases where we don't 
 know what we don't know, if you know what I mean :-)

 Kind regards 

 Hansel Dunlop
   



-- 





[web2py] Re: How to add Row object to Rows

2012-09-03 Thread andrej burja
what if i want newrows to contain only duplicates?
i want to display only rows which are in rows1 AND rows2

andrej

On Tuesday, June 5, 2012 7:22:11 PM UTC+2, Anthony wrote:

 I think you can do:

 myrows.records.append(myrow)

 Note, I don't think this is part of the documented API, so probably not 
 guaranteed to remain backward compatible (though I doubt it will change).

 You can also join two Rows objects:

 newrows = rows1  rows2
 newrows = rows1 | rows2  # this one removes duplicates from rows2 before 
 combining

 Anthony

 On Tuesday, June 5, 2012 1:10:58 PM UTC-4, Umpei Kurokawa wrote:

 Is it possible to insert or append Row objects to Rows?



-- 





[web2py] Flash File and Routes

2012-09-03 Thread Andrew Evans
Hello

I have a flash file that requires that the files associated with it be in
the same directory as views/default/index.html


I did a bit of research and read that I can have the view look like it is
in static or the static files look like they are in the views by using
routes.py although I am not certain how to do this

the files I have are:

index.html (this is the view)
piecemaker.swf
piecemakerCSS.css
piecemakerXML.xml

piecemaker.png
piecemaker2.png

and the images and js directories

any help is greatly appreciated...

*cheers

-- 





[web2py] Display Image

2012-09-03 Thread BlueShadow
I know this question has been asked multiple times but I still can't get it 
to work. I got a table containing an image name:
db.define_table('Images',
Field('Name',length=512),
Field('Image','upload'),
Field('Source',db.Source),
format = '%(Name)s' #  important
)
db.Images.Quelle.requires=IS_IN_DB(db,'Source.id','Quelle.Source')

Now I gat a table containing an article:
db.define_table('Article',
Field('Title',length=512),
Field('Content','text'),
Field('Sources',length=512),
Field('Submitted','datetime',default=datetime.datetime.now()),
Field('Views','integer',default=0),
Field('Author','reference auth_user',default=auth.user_id),
Field('TopImage',db.Images)
 )

In my controler I select the the Article which should be displayed:
def Article():
id=request.vars.id
row=db(db.Article.id==id).select()
if len(row)==0:
redirect(URL(r=request,f='Articles'))
return dict(Article=row[0])

and in my View I do the following:
{{print URL('download',args=Article.TopImage.Image)}}
centerimg src={{=URL('download',args=Article.TopImage.Image)}} /
 /center
I tried replacing upload with download and various other things. 
One of the Problems I think is that it is looking in delault. but the 
upload folder where the picture lands is in /appname/upload/

Thanks for your help

-- 





[web2py] Re: web2py book on github

2012-09-03 Thread Mandar Vaze


On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro 
wrote:

 The web2py book app has been rewritten 

http://www.web2py.com/book


Does this mean the PDF is also (automatically) updated ? I checked online, 
the PDF still says Build Date December 2011

-Mandar

-- 





[web2py] Re: How to add Row object to Rows

2012-09-03 Thread Anthony
rows1.records = [r for r in rows1.records if r in rows2.records]

Anthony

On Monday, September 3, 2012 11:59:41 AM UTC-4, andrej burja wrote:

 what if i want newrows to contain only duplicates?
 i want to display only rows which are in rows1 AND rows2

 andrej

 On Tuesday, June 5, 2012 7:22:11 PM UTC+2, Anthony wrote:

 I think you can do:

 myrows.records.append(myrow)

 Note, I don't think this is part of the documented API, so probably not 
 guaranteed to remain backward compatible (though I doubt it will change).

 You can also join two Rows objects:

 newrows = rows1  rows2
 newrows = rows1 | rows2  # this one removes duplicates from rows2 before 
 combining

 Anthony

 On Tuesday, June 5, 2012 1:10:58 PM UTC-4, Umpei Kurokawa wrote:

 Is it possible to insert or append Row objects to Rows?



-- 





[web2py] Re: Display Image

2012-09-03 Thread Anthony
First, are all these functions in the same controller? If not, be sure to 
specify the controller in URL(). Also, what does your download() function 
look like?

Anthony

On Monday, September 3, 2012 12:32:19 PM UTC-4, BlueShadow wrote:

 I know this question has been asked multiple times but I still can't get 
 it to work. I got a table containing an image name:
 db.define_table('Images',
 Field('Name',length=512),
 Field('Image','upload'),
 Field('Source',db.Source),
 format = '%(Name)s' #  important
 )
 db.Images.Quelle.requires=IS_IN_DB(db,'Source.id','Quelle.Source')

 Now I gat a table containing an article:
 db.define_table('Article',
 Field('Title',length=512),
 Field('Content','text'),
 Field('Sources',length=512),
 Field('Submitted','datetime',default=datetime.datetime.now()),
 Field('Views','integer',default=0),
 Field('Author','reference auth_user',default=auth.user_id),
 Field('TopImage',db.Images)
  )

 In my controler I select the the Article which should be displayed:
 def Article():
 id=request.vars.id
 row=db(db.Article.id==id).select()
 if len(row)==0:
 redirect(URL(r=request,f='Articles'))
 return dict(Article=row[0])

 and in my View I do the following:
 {{print URL('download',args=Article.TopImage.Image)}}
 centerimg src={{=URL('download',args=Article.TopImage.Image)}} /
  /center
 I tried replacing upload with download and various other things. 
 One of the Problems I think is that it is looking in delault. but the 
 upload folder where the picture lands is in /appname/upload/

 Thanks for your help


-- 





[web2py] Re: Flash File and Routes

2012-09-03 Thread Anthony
On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:

 Hello

 I have a flash file that requires that the files associated with it be in 
 the same directory as views/default/index.html


Why do they have to be in that particular folder? Why not just whatever 
folder contains the flash file (e.g., /static)?

Anthony

-- 





[web2py] Re: Cannot login via web2py mobile admin (V 2.0.6)

2012-09-03 Thread Massimo Di Pierro
I do not have an iphone but Android connects fine with https. Are you 
saying iPhones do not do https?

On Monday, 3 September 2012 09:37:13 UTC-5, Gerd wrote:

 I've used https on the iphone

 Am Montag, 3. September 2012 15:47:35 UTC+2 schrieb Massimo Di Pierro:

 Please check trunk. I think the problem is that admin requires https.

 On Monday, 3 September 2012 08:44:22 UTC-5, Massimo Di Pierro wrote:

 Ouch! Can can fix this.

 On Monday, 3 September 2012 07:27:33 UTC-5, Gerd wrote:

 Hi!

 First i want to thank Massimo and all the other contributors for their 
 great work!

 I've found an issue:
 When trying to login to the admin interface via an iPhone the web2py 
 mobile admin shows up, and there the Login-Button is not a button but a 
 text-field, see the screenshot

 regards
 Gerd




-- 





[web2py] Re: internal error crash with newest 2.0.6 and old 1.99.2

2012-09-03 Thread Massimo Di Pierro
The problem is this. Suppose you try do something that the db does not 
allow. For example insert a duplicate record or invalid sql etc. The 
database server will complain and expects you to rollback the transaction. 
If you do not rollback and try any other db operation, it will close the 
connection.

Normally this is handled automatically by web2py but since you are getting 
that error I assume you may be bypassing the mechanism.

A try except would by pass the mechanism because it would prevent web2py 
from detecting and db error and would continue execution.


On Monday, 3 September 2012 09:37:46 UTC-5, lucas wrote:

 ok, i have tons of db() accesses throughout a few thousand lines of code. 
  thinking out loud,   but since it has to do with session and/or logging in 
 and registering, then i can begin with the initial screens wherein the 
 cookies or such may be reset and such.  i have a few ideas of where, and in 
 those areas i will capture exceptions and rollback as suggested.  what 
 exactly is the exception for the db or DAL?  like


 try:
   some code
 except DBException on e:
   db.rollback()
   return 'db exception: %s' % e

 just so that i can at least return more tracking information also.  lucas


-- 





Re: [web2py] Classes in markmin

2012-09-03 Thread Massimo Di Pierro
markmin can be compared to reST (they are both markup languages)
Sphinx is an application to generate documents and does not directly 
compare.

Yet markmin2html and markmin2pdf do 90% of what Sphinx does. They do not 
enforce a convention on how you link documents. You can create your own 
convention. You can look at the source of the web2py book online and see 
how that works.



On Monday, 3 September 2012 09:59:10 UTC-5, viniciusban wrote:

 But is there some tool to generate offline docs, like Sphinx, using 
 themes and linking local pages? 

 That's what I'm looking for. 

 -- 
 Vinicius Assef 


 On 09/03/2012 01:54 AM, Bruno Rocha wrote: 
  There is markmin2pdf and markmin2html on gluon.contrib 
  
  https://github.com/web2py/web2py/tree/master/gluon/contrib/markmin 
  
  -- 
  
  
  


-- 





[web2py] Re: _custom_commit

2012-09-03 Thread Massimo Di Pierro
yes but it is response.custom_commit, not response._custom_commit.

On Monday, 3 September 2012 10:19:40 UTC-5, Anthony wrote:

 Looks like the old code is commented, but the logic was simply moved to 
 dal.BaseAdapter.close_all_instances, so should still work.

 Anthony

 On Monday, September 3, 2012 11:03:05 AM UTC-4, Corne Dickens wrote:

 See 
 https://groups.google.com/forum/?fromgroups#!topic/web2py-developers/pSF3WbO2B5o

 _custom_commit is commented out right now..
 (is this intentionally? And if so, what would be the way to call a custom 
 commit now in case your not using DAL?)



-- 





[web2py] Re: PythonAnywhere, upgrading to latest Web2Py?

2012-09-03 Thread Massimo Di Pierro
BTW. Great work with PythonAnywhere. :-)

On Monday, 3 September 2012 10:29:06 UTC-5, Hansel Dunlop wrote:

 Thanks Massimo, 

 We definitely heed your advice!

 Cheers 

 Hansel

 On Monday, 3 September 2012 14:41:19 UTC+1, Massimo Di Pierro wrote:

 Thank you Hansel,

 Do not use 2.0.2 because it has lots of issues. They have been fixed in 
 2.0.6 and I strongly suggest you us 2.0.6. It should not cause any 
 problems. We will soon be releasing 2.1 with yet more speed improvements 
 and features. You may want to week one more week.

 Massimo

 On Monday, 3 September 2012 06:32:24 UTC-5, Hansel Dunlop wrote:

 Hi all, 

 One of the PythonAnywhere developers here. 

 We are planning on updating our default version of Web2Py from 1.99.7 to 
 the latest 2.02. This would only be for new installs. Since it is a jump in 
 the major version number we were wondering if there was anything we should 
 know? How is the backwards compatibility? Will people require any code 
 changes if we start automating upgrades of existing sites? Any other things 
 that could cause problems?

 Sorry for the vague question. It is one of those cases where we don't 
 know what we don't know, if you know what I mean :-)

 Kind regards 

 Hansel Dunlop
   



-- 





[web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-03 Thread Stanislav Stankevich
I'm new in web2py, but really excited with the one. Thanks to Massimo Di 
Pierro. IMHO when I hided the breadcramb with CSS I lost nothing because 
the parents' positions are shown in the child tables.

пятница, 31 августа 2012 г., 18:59:38 UTC+4 пользователь Adi написал:

 trunk works for the first level, but doesn't when i drill down into the 
 second level... (image attached)

 also it used to display all breadcrumbs in the same line...

 old source code:
 div class=web2py_grid ui-widgetdiv class=web2py_breadcrumbsh3a 
 class=w2p_trap href=/list_suppliers/supplierSuppliers/a gt; a 
 class=w2p_trap href=
 /list_suppliers/supplier/view/supplier/21?_signature=3a9f06fff5edbc76efc140b8838b11063d1cd328
 Concept Laboratories, Inc./a gt; a class=w2p_trap href=
 /list_suppliers/supplier/purchase_order.supplier_id/21Purchase orders
 /a/h3/div

 so far, all seems to work perfectly fine on 2 apps :) had a migration 
 problem to alter scheduler tables (usual back and forth), but got it 
 working as well... continuing testing...

 thanks again for the best framework!


 On Thursday, August 30, 2012 4:36:40 PM UTC-4, Massimo Di Pierro wrote:

 Got it. fixed in trunk. This was not intentional!

 On Thursday, 30 August 2012 10:29:25 UTC-5, Adi wrote:

 Smartgrid used to display the table name automatically. Is that supposed 
 to be as before?



-- 





[web2py] Re: type='date' in form type='text'

2012-09-03 Thread Annet
Hi Anthony,

Note, this should now be fixed in trunk -- try it if you get a chance.


Thanks for fixing this issue right away. I just gave it a try and all 
fields have the right class now.


Kind regards,

Annet. 

-- 





Re: [web2py] Re: available Databases and Tables empty in 2.0.6

2012-09-03 Thread Annet


 General warning: upgrading the framework does not update any of the 
 framework specific files in the application folder, such as appadmin.py, 
 appadmin.html, web2py_ajax.html, web2py.js, and the generic views, so when 
 you upgrade, you may have to manually copy some of those files if they have 
 changed.


Thanks, I did wonder whether I had to update these files as well, I made a 
note of it in my log, so the next time I won't forget to check this first, 
before bothering any group members.

Kind regards,

Annet. 

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
I am really not sure why they have to be like that

But I did a test on my local system

I put the flash files and xml files etc in a separate directory and I put
index.html outside of that directory changed all the references to the swf
and css file and it would not work...

Any ideas


On Mon, Sep 3, 2012 at 9:52 AM, Anthony abasta...@gmail.com wrote:

 On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:

 Hello

 I have a flash file that requires that the files associated with it be in
 the same directory as views/default/index.html


 Why do they have to be in that particular folder? Why not just whatever
 folder contains the flash file (e.g., /static)?

 Anthony

 --





-- 





[web2py] Re: _custom_commit

2012-09-03 Thread Corne Dickens
I don't mind thad it's custom_commit instead of _custom_commit, but using the 
old one doesn't trigger an exception (its valid code), so nobody will notice 
anything right away..

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
I think because there are some hard coded values in the flash file but
since I can't change the file (cause of my version of flash)

its causing a problem

But I don't know what the hard coded values could be. The only values in
the flash file were references to the xml and images folder

Would appreciate any ideas though


ty

-- 





[web2py] Re: Display Image

2012-09-03 Thread BlueShadow
The Tables are in db.py(model)
def Article(): is in default.py(controler)
and the image Tag is in default/views/Article.html

I had no download function. I'm so stupid^^ no wonder it didn't work thanks 
anthony your help isalways really good. It works now

For anyone reading this with the same problem the download function looks 
like this:
def download():
return response.download(request, db)
and is located in default.py

On Monday, September 3, 2012 6:49:32 PM UTC+2, Anthony wrote:

 First, are all these functions in the same controller? If not, be sure to 
 specify the controller in URL(). Also, what does your download() function 
 look like?

 Anthony

 On Monday, September 3, 2012 12:32:19 PM UTC-4, BlueShadow wrote:

 I know this question has been asked multiple times but I still can't get 
 it to work. I got a table containing an image name:
 db.define_table('Images',
 Field('Name',length=512),
 Field('Image','upload'),
 Field('Source',db.Source),
 format = '%(Name)s' #  important
 )
 db.Images.Quelle.requires=IS_IN_DB(db,'Source.id','Quelle.Source')

 Now I gat a table containing an article:
 db.define_table('Article',
 Field('Title',length=512),
 Field('Content','text'),
 Field('Sources',length=512),
 Field('Submitted','datetime',default=datetime.datetime.now()),
 Field('Views','integer',default=0),
 Field('Author','reference auth_user',default=auth.user_id),
 Field('TopImage',db.Images)
  )

 In my controler I select the the Article which should be displayed:
 def Article():
 id=request.vars.id
 row=db(db.Article.id==id).select()
 if len(row)==0:
 redirect(URL(r=request,f='Articles'))
 return dict(Article=row[0])

 and in my View I do the following:
 {{print URL('download',args=Article.TopImage.Image)}}
 centerimg src={{=URL('download',args=Article.TopImage.Image)}} /
  /center
 I tried replacing upload with download and various other things. 
 One of the Problems I think is that it is looking in delault. but the 
 upload folder where the picture lands is in /appname/upload/

 Thanks for your help



-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Anthony
Can you show your code? How are you referencing those files in index.html?

On Monday, September 3, 2012 1:30:27 PM UTC-4, Andrew Evans wrote:

 I am really not sure why they have to be like that 

 But I did a test on my local system

 I put the flash files and xml files etc in a separate directory and I put 
 index.html outside of that directory changed all the references to the swf 
 and css file and it would not work...

 Any ideas


 On Mon, Sep 3, 2012 at 9:52 AM, Anthony abas...@gmail.com 
 javascript:wrote:

 On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:

 Hello

 I have a flash file that requires that the files associated with it be 
 in the same directory as views/default/index.html


 Why do they have to be in that particular folder? Why not just whatever 
 folder contains the flash file (e.g., /static)?

 Anthony

 -- 
  
  
  




-- 





[web2py] Re: _custom_commit

2012-09-03 Thread Massimo Di Pierro
The fact is we are trying to slim web2py and this is an undocumented 
parameter. The change was made long ago.


On Monday, 3 September 2012 12:34:26 UTC-5, Corne Dickens wrote:

 I don't mind thad it's custom_commit instead of _custom_commit, but using 
 the old one doesn't trigger an exception (its valid code), so nobody will 
 notice anything right away..


-- 





[web2py] Re: web2py book on github

2012-09-03 Thread Massimo Di Pierro
Planning to add that by the end of the week.

On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro 
 wrote:

 The web2py book app has been rewritten 

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked online, 
 the PDF still says Build Date December 2011

 -Mandar


-- 





[web2py] SQLFORM.grid CSS help

2012-09-03 Thread Massimo Di Pierro
Right now the gird console (defined in sqlhtml.py) looks like

[add] [input ] [search] [clear]
[hidden popup]
(records found ...)
 
but some times it shows up as

[add]
[input ...] [search] [clear]
[hidden popup]
(records found ...)

I would like it to consistently look like this

[input ...] [search] [clear]
[hidden popup]
[add]  (records found ...)

always to cols with popup in between, never 3 cols.

Can somebody help with this?


-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread Martín Mulone
Thanks massimo, this is a huge advance!, and the app is also very cool. I
started translation to spanish based on fork (29-english), here
https://github.com/mulonemartin/web2py-book.

2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro
 wrote:

 The web2py book app has been rewritten

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked
 online, the PDF still says Build Date December 2011

 -Mandar

  --







-- 
 http://www.tecnodoc.com.ar

-- 





[web2py] web2py 2.0.6/trunk appadmin ctrl+S not saving in FireFox

2012-09-03 Thread Brian M
Finally getting around to testing the new 2.0.x release from trunk and have 
spotted one issue so far - when editing a file in appadmin the ctrl+S 
shortcut isn't working in FireFox (v15.0 on Windows7) I instead get the 
browser's file save dialog.  For that matter even clicking the Save icon 
doesn't seem to be doing anything.  Works OK in Chrome and IE9.

-- 





[web2py] Re: web2py 2.0.6/trunk appadmin ctrl+S not saving in FireFox

2012-09-03 Thread Niphlod
I'm on ff 15 but on linux and it works okdid you try to ctrl+R the page 
to reload all the cached files ?

On Monday, September 3, 2012 8:35:30 PM UTC+2, Brian M wrote:

 Finally getting around to testing the new 2.0.x release from trunk and 
 have spotted one issue so far - when editing a file in appadmin the ctrl+S 
 shortcut isn't working in FireFox (v15.0 on Windows7) I instead get the 
 browser's file save dialog.  For that matter even clicking the Save icon 
 doesn't seem to be doing anything.  Works OK in Chrome and IE9.


-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-03 Thread Niphlod
you mean always two rows, with two columns every row, i.e. always:

row1-col1: input  row1-col2:search clear
row2-col1: addrow2-col2: records found

? 

On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro wrote:

 Right now the gird console (defined in sqlhtml.py) looks like

 [add] [input ] [search] [clear]
 [hidden popup]
 (records found ...)
  
 but some times it shows up as

 [add]
 [input ...] [search] [clear]
 [hidden popup]
 (records found ...)

 I would like it to consistently look like this

 [input ...] [search] [clear]
 [hidden popup]
 [add]  (records found ...)

 always to cols with popup in between, never 3 cols.

 Can somebody help with this?




-- 





[web2py] Possible regression in DAL?

2012-09-03 Thread Carlos Correia
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

After updating to trunk (Version 2.0.6 (2012-09-03 10:18:10) stable), I started
getting the following error in executesql():

In [1]: db.executesql( 'truncate auth_event' )
- ---
ProgrammingError  Traceback (most recent call last)
/home/carlos/development/m16e/apps/web/web2py/clusters/m16e/src/applications/belmiro/models/menu.py
in module()
-  1 db.executesql( 'truncate auth_event' )

/home/carlos/development/m16e/apps/web/web2py/clusters/m16e/src/gluon/dal.pyc in
executesql(self, query, placeholders, as_dict, fields, colnames)
   7247 # easier to work with. row['field_name'] rather than row[0]

   7248 return [dict(zip(fields,row)) for row in data]
- - 7249 data = adapter.cursor.fetchall()
   7250 if fields or colnames:
   7251 fields = [] if fields is None else fields

ProgrammingError: no results to fetch

Before the upgrade, I was using Version 2.00.0 (2012-08-03 09:01:00) dev

Thanks,
- -- 
Com os melhores cumprimentos,

Carlos Correia
=
MEMÓRIA PERSISTENTE
Tel.: 219 291 591 - GSM:  917 157 146 / 967 511 762
e-mail: ge...@memoriapersistente.pt - URL: http://www.memoriapersistente.pt
Jabber: m...@jabber.org
GnuPG: wwwkeys.eu.pgp.net
URL Suporte (experimental): https://ky.m16e.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBE/pwACgkQ90uzwjA1SJVQtgCg16jUoGCAI+BdSC9Qd3H/8EsE
vCIAn0vUHdDW+6Y/+9gTueMyET0JXRQO
=GVah
-END PGP SIGNATURE-

-- 





[web2py] Re: Checking for upgrades isn't working as I expected (1.99.7 installed)

2012-09-03 Thread Don_X
Hello Tim,
Welcome to web2py-users group !

Considering that you are new ! and probably you have not developed any apps 
yet in your web2py installation ( the 1.99.7 ) ...
you can simply  make a new install of the latest stable version ( now is 
the 2.0.5 ) ... under another folder if you want !

the checking for upgrades button does not work and no one actually noticed 
it until it was time to upgrade to the latest version ( which is recently 
.. ) .. before the 1.99.7 (minus - ) it used to work fine !
That being said ! ...  it should not stopped you from getting your feet wet 
with the latest web2py version which is awesome !

happy coding !

Don_X

On Thursday, August 30, 2012 8:29:19 AM UTC-4, Tim Richardson wrote:

 I'm a new user so I don't know what should happen when a new stable 
 release occurs.
 I have 1.99.7 source running on a Windows 2003 server. Python 2.7 
 (ActiveState). Browser is Firefox. Server is Rocket 1.2.4 on port 8010
 In the Admin home page under the version string (1.99.7) it reports 
 checking for upgrades... and that never completes ( I mean, that message 
 doesn't change)

 regards

 Tim




-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread Massimo Di Pierro
Mind that I believe there is already around a spanish translation of the 
3rd edition. 

There is also this version translated by google:

   https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf

and this one translated in portuguese by google:

   https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf





On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote:

 Thanks massimo, this is a huge advance!, and the app is also very cool. I 
 started translation to spanish based on fork (29-english), here 
 https://github.com/mulonemartin/web2py-book. 

 2012/9/3 Massimo Di Pierro massimo@gmail.com javascript:

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro 
 wrote:

 The web2py book app has been rewritten 

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked 
 online, the PDF still says Build Date December 2011

 -Mandar

  -- 
  
  
  




 -- 
  http://www.tecnodoc.com.ar



-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
Thank you for your help Anthony

the code in the head section

link rel=stylesheet href={{=URL('static','piecemakerCSS.css')}}
type=text/css /

script type=text/javascript src={{=URL('static',
'js/swfobject.js')}}/script
script type=text/javascript
swfobject.embedSWF({{=URL('static', 'piecemaker.swf')}}, piecemaker,
950, 350, 10.0.0.0, {{=URL('static', 'js/expressInstall.swf')}});
/script

and in the body

 script type=text/javascript
var flashvars = {};
flashvars.myurl = {{=URL('static',
'piecemaker.swf')}};
flashvars.width = 950;
flashvars.height = 350;

var params = {};
params.play = true;
params.loop = true;
params.menu = false;
params.quality = best;
params.scale = showall;
params.wmode = window;
params.swliveconnect = true;
params.allowfullscreen = true;
params.allowscriptaccess = always;
params.allownetworking = all;
var attributes = {};
attributes.id = container;
swfobject.embedSWF({{=URL('static',
'piecemaker.swf')}},myAlternativeContent,  950, 350, 10.0.0.0, false,
flashvars, params, attributes);
/script

div id=myAlternativeContent
a href=http://www.adobe.com/go/getflashplayer;
img src=
http://www.adobe.com/images/shared/download_buttons/
get_flash_player.gif alt=Get Adobe Flash player
/
/a
/div


here is a link to the online site
https://85.25.242.165/turtlebaychemists/default/index so you can see

I can attach the flash src file if you like *cheers

and ty once again for the help





On Mon, Sep 3, 2012 at 10:46 AM, Anthony abasta...@gmail.com wrote:

 Can you show your code? How are you referencing those files in index.html?


 On Monday, September 3, 2012 1:30:27 PM UTC-4, Andrew Evans wrote:

 I am really not sure why they have to be like that

 But I did a test on my local system

 I put the flash files and xml files etc in a separate directory and I put
 index.html outside of that directory changed all the references to the swf
 and css file and it would not work...

 Any ideas


 On Mon, Sep 3, 2012 at 9:52 AM, Anthony abas...@gmail.com wrote:

 On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:

 Hello

 I have a flash file that requires that the files associated with it be
 in the same directory as views/default/index.html


 Why do they have to be in that particular folder? Why not just whatever
 folder contains the flash file (e.g., /static)?

 Anthony

 --





  --





-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-03 Thread Massimo Di Pierro
No always two rows, no cols but records found should be on the same row 
as [add] but right-aligned.

On Monday, 3 September 2012 13:54:18 UTC-5, Niphlod wrote:

 you mean always two rows, with two columns every row, i.e. always:

 row1-col1: input  row1-col2:search clear
 row2-col1: addrow2-col2: records found

 ? 

 On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro wrote:

 Right now the gird console (defined in sqlhtml.py) looks like

 [add] [input ] [search] [clear]
 [hidden popup]
 (records found ...)
  
 but some times it shows up as

 [add]
 [input ...] [search] [clear]
 [hidden popup]
 (records found ...)

 I would like it to consistently look like this

 [input ...] [search] [clear]
 [hidden popup]
 [add]  (records found ...)

 always to cols with popup in between, never 3 cols.

 Can somebody help with this?




-- 





[web2py] Re: Limit Length column

2012-09-03 Thread Fabiano Faver
Se for somente para por um limite maximo. Há os parametros maxtextlenght, 
um limita todas as colunas para o mesmo e o outro você passa um dicionário 
com os campos e os limites.
Mas se for para setar um tamanho fixo para as colunas creio que será 
necessario usar CSS. 

Em segunda-feira, 3 de setembro de 2012 16h06min36s UTC-3, Ovidio Marinho 
escreveu:

 how to limit the size of columns in sqlform.grid
 25 
  40 
   15
 1 col lenght 25   
 === =
 2 col lenght 40
 3 col lenght 15
 etc...


   


Ovidio Marinho Falcao Neto
 Web Developer
  ovid...@gmail.com javascript: 
   ovidio...@itjp.net.br javascript:
  ITJP - itjp.net.br
83   8826 9088 - Oi
83   9334 0266 - Claro
 Brasil
   

 

-- 





[web2py] Re: Possible regression in DAL?

2012-09-03 Thread Massimo Di Pierro
we did remove a try... except in there that would have caused more problems.

Check out latest trunk and try:

   db.executesql('truncate auth_event',fetch=False)

else it expect the query to return something.

On Monday, 3 September 2012 14:01:57 UTC-5, Carlos Correia wrote:

 -BEGIN PGP SIGNED MESSAGE- 
 Hash: SHA1 

 Hi, 

 After updating to trunk (Version 2.0.6 (2012-09-03 10:18:10) stable), I 
 started 
 getting the following error in executesql(): 

 In [1]: db.executesql( 'truncate auth_event' ) 
 - 
 --- 
 ProgrammingError  Traceback (most recent call 
 last) 
 /home/carlos/development/m16e/apps/web/web2py/clusters/m16e/src/applications/belmiro/models/menu.py
  

 in module() 
 -  1 db.executesql( 'truncate auth_event' ) 

 /home/carlos/development/m16e/apps/web/web2py/clusters/m16e/src/gluon/dal.pyc 
 in 
 executesql(self, query, placeholders, as_dict, fields, colnames) 
7247 # easier to work with. row['field_name'] rather than 
 row[0] 

7248 return [dict(zip(fields,row)) for row in data] 
 - - 7249 data = adapter.cursor.fetchall() 
7250 if fields or colnames: 
7251 fields = [] if fields is None else fields 

 ProgrammingError: no results to fetch 

 Before the upgrade, I was using Version 2.00.0 (2012-08-03 09:01:00) dev 

 Thanks, 
 - -- 
 Com os melhores cumprimentos, 

 Carlos Correia 
 = 
 MEMÓRIA PERSISTENTE 
 Tel.: 219 291 591 - GSM:  917 157 146 / 967 511 762 
 e-mail: ge...@memoriapersistente.pt javascript: - URL: 
 http://www.memoriapersistente.pt 
 Jabber: m1...@jabber.org javascript: 
 GnuPG: wwwkeys.eu.pgp.net 
 URL Suporte (experimental): https://ky.m16e.com 
 -BEGIN PGP SIGNATURE- 
 Version: GnuPG v1.4.11 (GNU/Linux) 
 Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ 

 iEYEARECAAYFAlBE/pwACgkQ90uzwjA1SJVQtgCg16jUoGCAI+BdSC9Qd3H/8EsE 
 vCIAn0vUHdDW+6Y/+9gTueMyET0JXRQO 
 =GVah 
 -END PGP SIGNATURE- 


-- 





[web2py] Re: How to persist session data for user across browsers

2012-09-03 Thread monotasker
Thanks, that's probably the way to go.

On Sunday, September 2, 2012 12:20:13 AM UTC-4, Anthony wrote:

 As long as you're storing the session object, rather than trying to point 
 to the old session file, why not just write the session contents into the 
 new session?

 Anthony

 On Saturday, September 1, 2012 12:38:47 PM UTC-4, monotasker wrote:

 I'd like my app to preserve a state for each user for 24-hours, even if 
 s/he 
 - logs out and back in
 - switches browsers
 - switches IP (i.e., uses a different device)
 What would be the best way to do this? 

 I'm already using the session object to preserve state in the app. So I 
 was thinking that when the user first logs in I could save the 
 auth.user_id, datetime and session id in a db table. Then whenever the user 
 visits the site again (or logs in if s/he has logged out) I can 
 (a) check for a row in that table with the current user's id, 
 (b) check that it's datetime wasn't more than 24-hours ago, and 
 (c) if not, then set the current session cookie to point to the old 
 session file on the server (i.e., the old session id)

 If this sounds like a reasonable way to go, how would I trigger this when 
 a session cookie is being created?

 Thanks,

 Ian



-- 





[web2py] Re: Checking for upgrades isn't working as I expected (1.99.7 installed)

2012-09-03 Thread Massimo Di Pierro
There is a bug in 1.99.7 that prevents automatic upgrades. This is fixed in 
2.0.x but you cannot upgrade from the older versions via the web. 

Anyway, upgrade consists in unzipping new version over old version.

On Thursday, 30 August 2012 07:29:19 UTC-5, Tim Richardson wrote:

 I'm a new user so I don't know what should happen when a new stable 
 release occurs.
 I have 1.99.7 source running on a Windows 2003 server. Python 2.7 
 (ActiveState). Browser is Firefox. Server is Rocket 1.2.4 on port 8010
 In the Admin home page under the version string (1.99.7) it reports 
 checking for upgrades... and that never completes ( I mean, that message 
 doesn't change)

 regards

 Tim




-- 





Re: [web2py] Re: How to persist session data for user across browsers

2012-09-03 Thread monotasker
Perfect. Thanks for providing the snippet. I haven't used the cache methods 
yet, and this saves me a lot of time.

Ian

On Sunday, September 2, 2012 2:28:14 AM UTC-4, rochacbruno wrote:

 I think you can use cache.

 user_data = cache.ram(user_data_%s % auth.user_id, lambda : 
 dict(field=value, field=value), 86400)




-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-03 Thread Niphlod
gotcha, but I can't do without modifyng sqlhtml.py

Added also a few px of margin to align search and clear to the input, 
made it look similar to the add, back  Co., enlarged the search input a 
little bit (a requirement from all my users)

On Monday, September 3, 2012 9:12:00 PM UTC+2, Massimo Di Pierro wrote:

 No always two rows, no cols but records found should be on the same row 
 as [add] but right-aligned.

 On Monday, 3 September 2012 13:54:18 UTC-5, Niphlod wrote:

 you mean always two rows, with two columns every row, i.e. always:

 row1-col1: input  row1-col2:search clear
 row2-col1: addrow2-col2: records found

 ? 

 On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro wrote:

 Right now the gird console (defined in sqlhtml.py) looks like

 [add] [input ] [search] [clear]
 [hidden popup]
 (records found ...)
  
 but some times it shows up as

 [add]
 [input ...] [search] [clear]
 [hidden popup]
 (records found ...)

 I would like it to consistently look like this

 [input ...] [search] [clear]
 [hidden popup]
 [add]  (records found ...)

 always to cols with popup in between, never 3 cols.

 Can somebody help with this?




-- 



@@ -1854,12 +1854,6 @@
 
 session['_web2py_grid_referrer_'+formname] = url2(vars=request.vars)
 console = DIV(_class='web2py_console %(header)s %(cornertop)s' % ui)
-if create:
-console.append(gridbutton(
-buttonclass='buttonadd',
-buttontext='Add',
-buttonurl=url(args=['new',tablename])))
-
 error = None
 if searchable:
 sfields = reduce(lambda a,b:a+b,
@@ -1984,10 +1978,17 @@
 except SyntaxError:
 rows = None
 error = T(Query Not Supported)
+
+serviceconsole = DIV(_class=web2py_service_console)
+if create:
+serviceconsole.append(gridbutton(
+buttonclass='buttonadd',
+buttontext='Add',
+buttonurl=url(args=['new',tablename])))
 if nrows:
 message = error or T('%(nrows)s records found') % dict(nrows=nrows)
-console.append(DIV(message,_class='web2py_counter'))
-
+serviceconsole.append(DIV(message,_class='web2py_counter'))
+console.append(serviceconsole)
 if rows:
 htmltable = TABLE(THEAD(head))
 tbody = TBODY()
@@ -214,7 +214,7 @@
 
 .web2py_console form {
 width: 100%;
-display: inline;
+display: inline-block;
 vertical-align: middle;
 margin: 0 0 0 5px;
 }
@@ -251,6 +251,14 @@
 padding:3px 5px 3px 5px;
 }
 
+.web2py_console form input.btn {
+margin-bottom: 10px;
+padding: 4px 10px;
+}
+
+#web2py_keywords {
+width: 60%;
+}
 .web2py_counter {
 margin-top:5px;
 margin-right:5px;


[web2py] Re: web2py book on github

2012-09-03 Thread Don_X
Massimo,

Just a suggestion : 

In the various scripts included in the packages .. I realized that by 
default :  the default file rewritten for apache for example, contain Deny 
from all in various portion of the sh scripts ( for ubuntu, fedora, etc .. 
)

I recommend to make them  Allow from all  by default instead ...

for example :

  Location /admin
  Deny from all
  /Location

  LocationMatch ^/([^/]+)/appadmin
  Deny from all
  /LocationMatch


PS. There might be a few other places as well, I just pasted these few 
lines above for view purposes,

 that way, a user won't have to get into apache configuration files to fix 
this ... and , the individual will have his application up and running 
right after the script is done !


Else where  I noticed that you do not have any French version of the 
book ! .. Is there one in the works ?? .. would you need help ... I am 
French Canadian !
I know that There is a french  speaking web2py community ... are they on 
this ?? ..  I'll contact them so I can contribute  on my free time !

-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread Martín Mulone
I know but it's not in markmin, and make changes and sync is a hell pain.
Google translation is funny, is not serious.

2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com

 Mind that I believe there is already around a spanish translation of the
 3rd edition.

 There is also this version translated by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf

 and this one translated in portuguese by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf





 On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote:

 Thanks massimo, this is a huge advance!, and the app is also very cool. I
 started translation to spanish based on fork (29-english), here
 https://github.com/**mulonemartin/web2py-bookhttps://github.com/mulonemartin/web2py-book.


 2012/9/3 Massimo Di Pierro massimo@gmail.com

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro
 wrote:

 The web2py book app has been rewritten

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked
 online, the PDF still says Build Date December 2011

 -Mandar

  --







 --
  http://www.tecnodoc.com.ar

  --







-- 
 http://www.tecnodoc.com.ar

-- 





[web2py] how to display html entities from a db field in a form without escaping.

2012-09-03 Thread Jose C
 I've spent a couple of hours googling and rtfm-ing but can't seem to find 
a clean way of doing this.

I have a legacy database with various fields containing known, safe html 
text (e.g. `this amp; that` and things like apostrophes e.g. `John#39;s 
place`).  I need to use a number of these fields as options in multiple 
select boxes in a form.

Just using {{=XML(form)}} in the view doesn't work since it appears the 
form is preprocessed and it escapes the  in amp; resulting in raw html 
like `amp;amp;` being output (which then displays to the user as amp; 
instead of just the .

In the controller I use:
 form = SQLFORM.factory(
Field('regions',requires=IS_EMPTY_OR(IS_IN_DB(db, 
db.regions.id, '%(region)s', orderby='sort_order', multiple=True))),

Is there a way to tell web2py that the contents of a field, coming from a 
db, are safe prior to it rendering the form so that it does not escape it? 

Thank you,
JC

-- 





Re: [web2py] Re: How to persist session data for user across browsers

2012-09-03 Thread Anthony
You might need to occasionally clear out old data so the cache doesn't grow 
indefinitely.

Anthony

On Monday, September 3, 2012 3:19:17 PM UTC-4, monotasker wrote:

 Perfect. Thanks for providing the snippet. I haven't used the cache 
 methods yet, and this saves me a lot of time.

 Ian

 On Sunday, September 2, 2012 2:28:14 AM UTC-4, rochacbruno wrote:

 I think you can use cache.

 user_data = cache.ram(user_data_%s % auth.user_id, lambda : 
 dict(field=value, field=value), 86400)




-- 





[web2py] Twitter account for @web2py

2012-09-03 Thread Luther Goh Lu Feng
I just noticed that the twitter account has been very inactive :o

Is there any reason for that? Anyway to improve the situation?

https://twitter.com/web2py

-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread Bruno Rocha
Martin, I am doing the same for portuguese.

Which number did you named your spanish version?
36-spanish-work-in-progress ?

I forked and I will put a 37-portuguese-work-in-progress

On Mon, Sep 3, 2012 at 4:27 PM, Martín Mulone mulone.mar...@gmail.comwrote:

 I know but it's not in markmin, and make changes and sync is a hell pain.
 Google translation is funny, is not serious.

 2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com

 Mind that I believe there is already around a spanish translation of the
 3rd edition.

 There is also this version translated by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf

 and this one translated in portuguese by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf





 On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote:

 Thanks massimo, this is a huge advance!, and the app is also very cool.
 I started translation to spanish based on fork (29-english), here
 https://github.com/**mulonemartin/web2py-bookhttps://github.com/mulonemartin/web2py-book.


 2012/9/3 Massimo Di Pierro massimo@gmail.com

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro
 wrote:

 The web2py book app has been rewritten

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked
 online, the PDF still says Build Date December 2011

 -Mandar

  --







 --
  http://www.tecnodoc.com.ar

  --







 --
  http://www.tecnodoc.com.ar

  --





-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread Alfonso de la Guarda
Massimo,

The Latinux people translate the book (spanish) however no sources
available and also there is a lot of new features with the new
versions, maybe you can ask to them for open the sources and publish
(Ricardo Strusberg surely can do), if not we need to start a new
translation.


Saludos,


Alfonso de la Guarda
Twitter: @alfonsodg
Redes sociales: alfonsodg
   Telef. 991935157
1024D/B23B24A4
5469 ED92 75A3 BBDB FD6B  58A5 54A1 851D B23B 24A4


On Mon, Sep 3, 2012 at 2:10 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
 Mind that I believe there is already around a spanish translation of the 3rd
 edition.

 There is also this version translated by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf

 and this one translated in portuguese by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf





 On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote:

 Thanks massimo, this is a huge advance!, and the app is also very cool. I
 started translation to spanish based on fork (29-english), here
 https://github.com/mulonemartin/web2py-book.

 2012/9/3 Massimo Di Pierro massimo@gmail.com

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro
 wrote:

 The web2py book app has been rewritten

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked
 online, the PDF still says Build Date December 2011

 -Mandar

 --







 --
  http://www.tecnodoc.com.ar

 --




-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread Martín Mulone
I'm using 36, but this can be changed very easy in the app.

2012/9/3 Bruno Rocha rochacbr...@gmail.com


 Martin, I am doing the same for portuguese.

 Which number did you named your spanish version?
 36-spanish-work-in-progress ?

 I forked and I will put a 37-portuguese-work-in-progress

 On Mon, Sep 3, 2012 at 4:27 PM, Martín Mulone mulone.mar...@gmail.comwrote:

 I know but it's not in markmin, and make changes and sync is a hell pain.
 Google translation is funny, is not serious.

 2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com

 Mind that I believe there is already around a spanish translation of the
 3rd edition.

 There is also this version translated by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf

 and this one translated in portuguese by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf





 On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote:

 Thanks massimo, this is a huge advance!, and the app is also very cool.
 I started translation to spanish based on fork (29-english), here
 https://github.com/**mulonemartin/web2py-bookhttps://github.com/mulonemartin/web2py-book.


 2012/9/3 Massimo Di Pierro massimo@gmail.com

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di
 Pierro wrote:

 The web2py book app has been rewritten

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked
 online, the PDF still says Build Date December 2011

 -Mandar

  --







 --
  http://www.tecnodoc.com.ar

  --







 --
  http://www.tecnodoc.com.ar

  --






  --







-- 
 http://www.tecnodoc.com.ar

-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-03 Thread Massimo Di Pierro
When I click on the [input] search field, and the popup appears, the [add] 
button moves to the right of the popup. :-(


On Monday, 3 September 2012 14:24:26 UTC-5, Niphlod wrote:

 gotcha, but I can't do without modifyng sqlhtml.py

 Added also a few px of margin to align search and clear to the input, 
 made it look similar to the add, back  Co., enlarged the search input a 
 little bit (a requirement from all my users)

 On Monday, September 3, 2012 9:12:00 PM UTC+2, Massimo Di Pierro wrote:

 No always two rows, no cols but records found should be on the same row 
 as [add] but right-aligned.

 On Monday, 3 September 2012 13:54:18 UTC-5, Niphlod wrote:

 you mean always two rows, with two columns every row, i.e. always:

 row1-col1: input  row1-col2:search clear
 row2-col1: addrow2-col2: records found

 ? 

 On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro wrote:

 Right now the gird console (defined in sqlhtml.py) looks like

 [add] [input ] [search] [clear]
 [hidden popup]
 (records found ...)
  
 but some times it shows up as

 [add]
 [input ...] [search] [clear]
 [hidden popup]
 (records found ...)

 I would like it to consistently look like this

 [input ...] [search] [clear]
 [hidden popup]
 [add]  (records found ...)

 always to cols with popup in between, never 3 cols.

 Can somebody help with this?




-- 





Re: [web2py] Re: web2py book on github

2012-09-03 Thread António Ramos
I wish you could make the table of contents fixed so i dont have to
scroooll all way to the top to change to another chapter.

Best regards
António

2012/9/3 Martín Mulone mulone.mar...@gmail.com

 I'm using 36, but this can be changed very easy in the app.


 2012/9/3 Bruno Rocha rochacbr...@gmail.com


 Martin, I am doing the same for portuguese.

 Which number did you named your spanish version?
 36-spanish-work-in-progress ?

 I forked and I will put a 37-portuguese-work-in-progress

 On Mon, Sep 3, 2012 at 4:27 PM, Martín Mulone mulone.mar...@gmail.comwrote:

 I know but it's not in markmin, and make changes and sync is a hell
 pain. Google translation is funny, is not serious.

 2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com

 Mind that I believe there is already around a spanish translation of
 the 3rd edition.

 There is also this version translated by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf

 and this one translated in portuguese by google:

https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf





 On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote:

 Thanks massimo, this is a huge advance!, and the app is also very
 cool. I started translation to spanish based on fork (29-english), here
 https://github.com/**mulonemartin/web2py-bookhttps://github.com/mulonemartin/web2py-book.


 2012/9/3 Massimo Di Pierro massimo@gmail.com

 Planning to add that by the end of the week.


 On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote:



 On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di
 Pierro wrote:

 The web2py book app has been rewritten

http://www.web2py.com/book


 Does this mean the PDF is also (automatically) updated ? I checked
 online, the PDF still says Build Date December 2011

 -Mandar

  --







 --
  http://www.tecnodoc.com.ar

  --







 --
  http://www.tecnodoc.com.ar

  --






  --







 --
  http://www.tecnodoc.com.ar

  --





-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-03 Thread Niphlod
that should definitely not happen. tested on ff and chromium.
that happened before I switched from
.web2py_console form {
width: 100%;
display: inline;
vertical-align: middle;
margin: 0 0 0 5px;
}
to 
.web2py_console form {
width: 100%;
display: inline-block;
vertical-align: middle;
margin: 0 0 0 5px;
}
Can you please check if form is displayed as inline-block ? (maybe 
refresh your browser cache...)

On Monday, September 3, 2012 9:39:58 PM UTC+2, Massimo Di Pierro wrote:

 When I click on the [input] search field, and the popup appears, the [add] 
 button moves to the right of the popup. :-(


 On Monday, 3 September 2012 14:24:26 UTC-5, Niphlod wrote:

 gotcha, but I can't do without modifyng sqlhtml.py

 Added also a few px of margin to align search and clear to the input, 
 made it look similar to the add, back  Co., enlarged the search input a 
 little bit (a requirement from all my users)

 On Monday, September 3, 2012 9:12:00 PM UTC+2, Massimo Di Pierro wrote:

 No always two rows, no cols but records found should be on the same 
 row as [add] but right-aligned.

 On Monday, 3 September 2012 13:54:18 UTC-5, Niphlod wrote:

 you mean always two rows, with two columns every row, i.e. always:

 row1-col1: input  row1-col2:search clear
 row2-col1: addrow2-col2: records found

 ? 

 On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro wrote:

 Right now the gird console (defined in sqlhtml.py) looks like

 [add] [input ] [search] [clear]
 [hidden popup]
 (records found ...)
  
 but some times it shows up as

 [add]
 [input ...] [search] [clear]
 [hidden popup]
 (records found ...)

 I would like it to consistently look like this

 [input ...] [search] [clear]
 [hidden popup]
 [add]  (records found ...)

 always to cols with popup in between, never 3 cols.

 Can somebody help with this?




-- 





[web2py] Re: How to persist session data for user across browsers

2012-09-03 Thread Jose C
Just a thought... cache.ram does have the potential drawback that if your 
server goes down, you lose that 24 hour history.  May or may not be a 
problem in your situation - if it is then use something like 
cache_in_ram_and_disk() https://web2py.com/books/default/chapter/29/04 to 
give you some fault tolerance.

JC


-- 





  1   2   >