[web2py] Re: cannot operate on a closed database

2014-05-09 Thread aleonserra
The error suggest that dal couldnt connect to the database. It doesnt look 
like a web2py problem but a db one. 
at line 4 add .select() to execute the statement.
row = db(db.auth_user.username == username).select()

Also start a web2py shell session (web2py -a  -M)and test the 
database by executing the line above. 
Check if theres any line on your code that closes the connection.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: cannot operate on a closed database

2014-05-09 Thread Wonton
Hello aleonserra,

Thank you very much for your answer.
The problem is that I have no admin access to the server so I cannot 
execute that command, and in my local server everything works fine, so I 
cannot replicate the error.

On the other hand I've searched through all my code and I never close the 
db connection (I'm not sure how to close the connection, but if I have to 
call close() I never call that).

Anyway, if I call any of my others web services, for example, one that 
write a data in the DDBB and one that read that data from the database, 
everything works fine, so it seems that web2py can access the DDBB without 
problems. There are only 2 web services with that error and both use 
session.activity, so could it be a problem with sessions??

Maybe I have to say that session.activity stores all the lifetime activity 
of a user, so that variable can store a high amount of data. But I create a 
new user (whose lifetime activity is empty), called that two web services 
and I got the same error, so it seems that there is no problem with the 
amount of data stored in session.activity.

Kind regards and thank you again.

Rubén.

On Friday, May 9, 2014 12:23:07 PM UTC+2, aleon...@gmail.com wrote:
>
> The error suggest that dal couldnt connect to the database. It doesnt look 
> like a web2py problem but a db one. 
> at line 4 add .select() to execute the statement.
> row = db(db.auth_user.username == username).select()
>
> Also start a web2py shell session (web2py -a  -M)and test 
> the database by executing the line above. 
> Check if theres any line on your code that closes the connection.
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Reload page on component form submit

2014-05-09 Thread Carlos Cesar Caballero Díaz

Stewart, thanks for sharing such clear example!!!


El 08/05/14 22:51, LaDarrius Stewart escribió:

---controller--
@auth.requires_login()
def test():
a=request.args(0)
form=SQLFORM(db.Notes).process()
form.vars.TestID = a
comments=db(db.Test.TestID==a).select()
if form.process(formname="somename").accepted:
form.vars.TestID = a
redirect(URL('default','test', args=[request.args(0)]))
return dict(form=form, comments=comments)
---test.load 
file---
data-target="#cd" type="button" >Add note!


  Add a Note
{{=form}}
 


  Current Comments: 

  {{for item2 in reversed(comments):}}
  Posted on: {{=item2.created_on}} By: 
{{=item2.created_by.first_name}} {{=item2.created_by.last_name}}

  
  {{=item2.NoteSummary}} {{pass}}
-FOR 
VIEW--
 {{=LOAD('default','notestest.load',ajax=False, ajax_trap=True, 
args=[request.args(0)])}}


On Thursday, May 8, 2014 11:05:37 AM UTC-5, Carlos Cesar Caballero 
Díaz wrote:


Anthony, thanks for your answer.

Of course, the form is submitted to the parent page... I think
that I should rest a litle and continue tomorrow...

Thanks again for your answer


El 08/05/14 10:10, Anthony escribió:

You should not set ajax_trap=False, as that will cause the form
to be submitted to the action of the parent page rather than the
action of the component. Instead, in your form processing code,
if the form is accepted, you can do a redirect to the parent page
URL, which will cause that URL to reload.

Anthony

On Thursday, May 8, 2014 9:50:08 AM UTC-4, Carlos Cesar Caballero
Díaz wrote:

I need to reload a page when a component form is submitted,
the book says that |"ajax_trap=False| indicates that forms
must be submitted normally, thus reloading the entire page".
Using |"ajax_trap=False" |the page is reloaded, but the form
action is not executed (there is no new entry in the db
table). There is my code:

db.py:
...
db.define_table('mytable',Field('myfield','string'))


default.py:
...
def test_component():
form = crud.create(db.mytable)
return dict(form=form)
...


default/test_component.load:
{{=form}}

default/index.php:
{{
=LOAD('default','test_component.load',ajax_trap=False)
}}


||

-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to the
Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to web2py+un...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout
.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.




--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-09 Thread duncan macneil
Hi Massimo,

My pleasure. You may remember me from trying to get Web2Py running under 
Jython in a Websphere servlet container environment a while back. I didn't 
ever get there fully. So having this way to run in the IBM ecosystem is 
nice.

I have been emailing a bit with one of the contacts from IBM. I'll ask 
about a blog, and perhaps if warranted, a short video tutorial would also 
be good. 

One minor detail I'd add to a tutorial is remembering to add the 
fake-migration flag to the JazzHub Web2Py codebase after initial deploy, to 
prevent subsequent deploys without db changes from getting confused with a 
set up db, but no updates in database migration files. In fact, this would 
probably a good reason for showing off BlueMix spaces, where one space 
could be called 'for_single-instance_migration_only' or similar.

Also a minor error in my original post: where I mentioned moving sessions 
to the db. It seems that is already the default, you just need all 
instances pointing at the same db.

I'll let you know how I get on with an IBM update/blog post.

Regs,
Duncan.

On Thursday, 8 May 2014 22:25:49 UTC+10, Massimo Di Pierro wrote:
>
> Thank you Duncan,
>
> this is very valuable. There should be a setup script for this shipping 
> with web2py. Is there any IBM blog wjere we could advertise it?
>
> Massimo
>
> On Tuesday, 6 May 2014 19:29:48 UTC-5, duncan macneil wrote:
>>
>> Hi all,
>>
>> I've been trying out the www.bluemix.net IBM PaaS. 
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Do we need a "response.files" for footer as well as header?

2014-05-09 Thread Carlos Cesar Caballero Díaz
I think Joe has a valid point, put the javascript at the end does not 
show a real improvement in the loading time, but it gives users a 
feeling of greater speed, but we must be careful when selecting which 
javascript files can go to the end and which not.
I'm not entirely sure if is necessary to implement the Joe request, but 
I think that put javascript files at the end sometimes is useful.


El 09/05/14 02:41, Niphlod escribió:
A word of advice, don't follow buzzword advices before hitting the 
problem.
When faced with reality, there were lots of people "putting javascript 
at the bottom" but forgetting that if you transfer them every time (or 
wait for a 304) --> 100x worse.
Also, people "putting at the bottom" don't realize that they are 
working towards - usually - 5 ms improvements. Yep, it's an 
improvement, but don't waste night hours on it.


On Friday, May 9, 2014 12:46:13 AM UTC+2, Joe Barnhart wrote:

Some folks recommend javascript files be placed at the end of the
page to facilitate fast loading. We have the "response.files"
idiom that makes it easy to compress and serve the static files,
but it with response.include_files() to append the files to the
header.  It can't serve both header and footer at present.

Is there a need to have a new variable which does the same thing,
but is defined to be used for scripts in the footer area?  Or is
it not really important to load static script files with the end
of the page instead of the header?

-- Joe

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.




--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-09 Thread duncan macneil
On Thursday, 8 May 2014 22:29:31 UTC+10, Willoughby wrote:
>
> Is Azure in your shoot-out?  I'd be interested in hearing those results...
>
>>
>>>
Hey, woah, I'm the cloud shootout guy now? ;-) Cool!

I have had a small-to-serious look at Azure, Google Compute, Amazon, 
Rackspace, Heroku, etc. There are more serious cloud comparison efforts 
than mine, for sure! 

In the end, my prediction is that cloud computing, storage, CDN etc will 
become such a hyper-commodity that your future app-hosting dash will 
instead be via a cloud aggregator. 

That future cloud aggregator would report something like:

"Good morning, Dave. Your application 'MyCoolApp' is healthy. It is 
currently running across 4 continents and 17 cloud providers. CDN has been 
weighted to 3 providers based on our 'Gamma' speed/price ratio, last 
updated on Tuesday. One provider was dropped due to a terms-of-service 
change. Your current redundancy profile allows you to drop 1 continent or 
up to 5 providers at any time without business interruption. Your 
application load balancers route to compute-intensive servers in the UK 
between 2:30 and 4:30pm weekdays GMT due to a weekday spike detected for 
which your compute pricing was previously not optimal. Your data is hosted 
on a shared-secrets algorithm model. At least 6 providers would need to 
collaborate in order to decrypt the data they host for you. Your monthly 
fees total is currently 16.2 Cayman Bitcoins, for which you have earned 
0.001 Frequent SpaceMiles points. Thank you."



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-09 Thread Don O'Hara

Very nice "morning report"!  It gives a framework that can  be developed into a 
large paper explaining
what each term means; the pros/cons of the available options (at this point in 
time);
motivations for design choices; future technologies to become aware of; etc; 
etc.

Then it can become an O'Reilly book.!

Don



On May 9, 2014, at 9:33, duncan macneil  wrote:

> On Thursday, 8 May 2014 22:29:31 UTC+10, Willoughby wrote:
> Is Azure in your shoot-out?  I'd be interested in hearing those results...
> 
> 
> Hey, woah, I'm the cloud shootout guy now? ;-) Cool!
> 
> I have had a small-to-serious look at Azure, Google Compute, Amazon, 
> Rackspace, Heroku, etc. There are more serious cloud comparison efforts than 
> mine, for sure! 
> 
> In the end, my prediction is that cloud computing, storage, CDN etc will 
> become such a hyper-commodity that your future app-hosting dash will instead 
> be via a cloud aggregator. 
> 
> That future cloud aggregator would report something like:
> 
> "Good morning, Dave. Your application 'MyCoolApp' is healthy. It is currently 
> running across 4 continents and 17 cloud providers. CDN has been weighted to 
> 3 providers based on our 'Gamma' speed/price ratio, last updated on Tuesday. 
> One provider was dropped due to a terms-of-service change. Your current 
> redundancy profile allows you to drop 1 continent or up to 5 providers at any 
> time without business interruption. Your application load balancers route to 
> compute-intensive servers in the UK between 2:30 and 4:30pm weekdays GMT due 
> to a weekday spike detected for which your compute pricing was previously not 
> optimal. Your data is hosted on a shared-secrets algorithm model. At least 6 
> providers would need to collaborate in order to decrypt the data they host 
> for you. Your monthly fees total is currently 16.2 Cayman Bitcoins, for which 
> you have earned 0.001 Frequent SpaceMiles points. Thank you."
> 
> 
> 
> 
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-09 Thread Tito Garrido
Hi Duncan,

It is my first time deploying web2py on a PaSS could you please let me know
how to proceed on step 1?
Step 1:

Use the source version of Web2Py and copy the entire lot into a folder
path: 'env/app' so that web2py.py is in the 'app' folder.

Step 2:

You need to have a requirements.txt file in the 'app' folder -- even if it
is empty. (Although you might want to add a single line with just psycopg2,
for example.)

How to access the folder path? I could manage to install cf-cli but I have
no idea how to access this folder path so I can copy the source... Also,
should I do anything to enable python?

Regards,

Tito





On Fri, May 9, 2014 at 10:44 AM, Don O'Hara  wrote:

>
> Very nice “morning report”!  It gives a framework that can  be developed
> into a large paper explaining
> what each term means; the pros/cons of the available options (at this
> point in time);
> motivations for design choices; future technologies to become aware of;
> etc; etc.
>
> Then it can become an O’Reilly book…..!
>
> Don
>
>
>
> On May 9, 2014, at 9:33, duncan macneil  wrote:
>
> On Thursday, 8 May 2014 22:29:31 UTC+10, Willoughby wrote:
>>
>> Is Azure in your shoot-out?  I'd be interested in hearing those results...
>>
>>>

> Hey, woah, I'm the cloud shootout guy now? ;-) Cool!
>
> I have had a small-to-serious look at Azure, Google Compute, Amazon,
> Rackspace, Heroku, etc. There are more serious cloud comparison efforts
> than mine, for sure!
>
> In the end, my prediction is that cloud computing, storage, CDN etc will
> become such a hyper-commodity that your future app-hosting dash will
> instead be via a cloud aggregator.
>
> That future cloud aggregator would report something like:
>
> "Good morning, Dave. Your application 'MyCoolApp' is healthy. It is
> currently running across 4 continents and 17 cloud providers. CDN has been
> weighted to 3 providers based on our 'Gamma' speed/price ratio, last
> updated on Tuesday. One provider was dropped due to a terms-of-service
> change. Your current redundancy profile allows you to drop 1 continent or
> up to 5 providers at any time without business interruption. Your
> application load balancers route to compute-intensive servers in the UK
> between 2:30 and 4:30pm weekdays GMT due to a weekday spike detected for
> which your compute pricing was previously not optimal. Your data is hosted
> on a shared-secrets algorithm model. At least 6 providers would need to
> collaborate in order to decrypt the data they host for you. Your monthly
> fees total is currently 16.2 Cayman Bitcoins, for which you have earned
> 0.001 Frequent SpaceMiles points. Thank you."
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: What is a clear procedure to style web2py css files using Bootstrap theme generators/choosers?

2014-05-09 Thread JoeCodeswell
Dear LightDot and Ari,

Thanks for the responses. The situation is getting clearer in my mind.

I have some follow-on questions for LightDot. You said:

Details such as whether you need to replace just bootstrap.min.css (and 
> keep the original bootstrap-responsive.min.css) or replace the 
> bootstrap.min.css and remove bootstrap-responsive.min.css altogether, are 
> going to be stated in the documentation of the theme / project you're 
> switching to.


I am sure you know WAY more about the history of Bootstrap and its 
documentation than I do. I went to http://bootswatch.com/2/ and looked at 
the Cerulean Preview, which seems to me to be the "the documentation of the 
theme". I did a firefox page search for "min". Result: "Phrase not found".

Here are my questions, LightDot. Thanks in advance for educating me.

Does every Bootstrap2 theme have a *correspondingly 
developed*bootstrap-responsive.min.css? I assume the answer to this is NO.

Will every Bootstrap2 theme work with a *separately 
developed*bootstrap-responsive.min.css?

Will the web2py default bootstrap-responsive.min.css "work" with any 
Bootstrap2 theme's bootstrap.min.css? If, YES, generally what will the 
result look like, when the bootstrap-responsive.min.css is in control?

Thanks again, LightDot and Ari.

Love and peace,

Joe

On Wednesday, May 7, 2014 11:57:54 AM UTC-7, ari northage-orr wrote:
>
> LightDot is correct, this is due to the fact that web2py comes with 
>> bootstrap 2. I had the exact same issue as you, I was trying to use a theme 
>> from Bootswatch and it ended up breaking the navbar and messing up the 
>> placement of things on my page. Googling themes for bootstrap 2 and using 
>> one of those fixed the issue completely. 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-09 Thread Willoughby
I love the vision, but my lawyers would never allow it! LOL

On Friday, May 9, 2014 9:33:33 AM UTC-4, duncan macneil wrote:
>
> On Thursday, 8 May 2014 22:29:31 UTC+10, Willoughby wrote:
>>
>> Is Azure in your shoot-out?  I'd be interested in hearing those results...
>>
>>>

> Hey, woah, I'm the cloud shootout guy now? ;-) Cool!
>
> I have had a small-to-serious look at Azure, Google Compute, Amazon, 
> Rackspace, Heroku, etc. There are more serious cloud comparison efforts 
> than mine, for sure! 
>
> In the end, my prediction is that cloud computing, storage, CDN etc will 
> become such a hyper-commodity that your future app-hosting dash will 
> instead be via a cloud aggregator. 
>
> That future cloud aggregator would report something like:
>
> "Good morning, Dave. Your application 'MyCoolApp' is healthy. It is 
> currently running across 4 continents and 17 cloud providers. CDN has been 
> weighted to 3 providers based on our 'Gamma' speed/price ratio, last 
> updated on Tuesday. One provider was dropped due to a terms-of-service 
> change. Your current redundancy profile allows you to drop 1 continent or 
> up to 5 providers at any time without business interruption. Your 
> application load balancers route to compute-intensive servers in the UK 
> between 2:30 and 4:30pm weekdays GMT due to a weekday spike detected for 
> which your compute pricing was previously not optimal. Your data is hosted 
> on a shared-secrets algorithm model. At least 6 providers would need to 
> collaborate in order to decrypt the data they host for you. Your monthly 
> fees total is currently 16.2 Cayman Bitcoins, for which you have earned 
> 0.001 Frequent SpaceMiles points. Thank you."
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] thumbnails plugin

2014-05-09 Thread Carlos Cesar Caballero Díaz

Hi, this is a first aproach of a thumbnails plugin, needs PIL to work.
Any recomendations will be apreciated (I don't like so much what I am 
doing with the database)



--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


web2py.plugin.thumbnails.w2p
Description: Binary data


Re: [web2py] Re: Does Web2py Postgres Adapter support JSON as native type ?

2014-05-09 Thread Mandar Vaze / मंदार वझे
On Thu, May 8, 2014 at 6:25 PM, Anthony  wrote:

> And here's where it happens in the code:
> https://github.com/web2py/web2py/blob/master/gluon/dal.py#L2886
>

Thanks for pointing the relevant piece of code.
Definitely helps !!!

-Mandar

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] is CAT() causing RuntimeError: maximum recursion depth exceeded in cmp ?

2014-05-09 Thread SimonD
Hi,
I would like to seek knowledge/expertise.

I have this function - which shows "all user activity in the previous 90 
days"
def all_activity():

tabledata=TR(B('Date/Time'),B('User'),B('Activity'),_style='background-color:lightblue;')
  
#formatted header
for row in 
db(db.activity.date_time>datetime.datetime.today()-datetime.timedelta(days=91)).select(db.activity.date_time,
db.activity.user_email,db.activity.activity, 
orderby=~db.activity.date_time):

tabledata=CAT(tabledata,TR(TD(row.date_time.strftime('%d %b %Y, 
(%H:%M %p)'),_style='white-space:nowrap;'),row.user_email,row.activity))
#using CAT() to build the rows

return dict(rows=TABLE(tabledata)) 

Although it may seem an unusual way to create a table (is it?), it 
works. except that when I get to about 350 records I get this error:

RuntimeError: maximum recursion depth exceeded in cmp


After some elimination-testing, it seems the CAT() helper is at the root of 
the issue

If the function is written like this:
def all_activity():
tabledata=[]

tabledata.append(TR(B('Date/Time'),B('User'),B('Activity'),_style='background-color:lightblue;'))
for row in 
db(db.activity.date_time>datetime.datetime.today()-datetime.timedelta(days=91)).select(db.activity.date_time,
db.activity.user_email,db.activity.activity, 
orderby=~db.activity.date_time):

tabledata.append(TR(TD(row.date_time.strftime('%d %b %Y, (%H:%M 
%p)'),_style='white-space:nowrap;'),row.user_email,row.activity))
#essentialy using a tuple instead of CAT()

return dict(rows=TABLE(tabledata)) 

...the error appears to go away.
Yes - I know that the second verion of the function (using tuples) is a 
better way - it was just that I was taken by surprise with the error.

My function is not recursive, but raising a recursive exception.

So, I want to get the view of experts why the CAT() helper would be causing 
the problem?
Essentially, is re-iterating CAT() causing a recursive issue?

If so, is there a way to make the CAT() helper work in this scenario?

BTW - this is on 2.9.5+rocket+sqlite. I also have the issue with 
2.9.5+apaches+mod_wsgi
I saw a note one this forums that claims a move to MySQL would solve the 
error. But I am note sure I have exactly the same symptoms and scenario.

Thanks for the guidance.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: is it allowed/possible to replace the database within a controler ?

2014-05-09 Thread Stef Mientki

thanks Anthony,

Thought it was difficult to generate a scheduled task. But in 
PythonAnyWhere it'standard available. So I'll go that way.


Still wondering if it's allowed to copy the default web2py database in a 
controler function ?


cheers,
Stef

On 09-05-14 0:02, Anthony wrote:
You probably don't want a web request to potentially have to wait for 
a database copy over the network before returning a result. It would 
probably make more sense to set up a scheduled task to replicate the 
database once a day. Or better yet, look into the replication options 
offered by your RDBMS (e.g., 
http://www.postgresql.org/docs/9.3/static/high-availability.html).


Anthony

On Thursday, May 8, 2014 4:30:03 PM UTC-4, aapaap wrote:

hello,

I've a web2py site, which should run, more or less synchronized,
(with
the same data)  on 2 different servers.

The first one is filling the database.

The second one should copy the db from the first one if the
database was
refreshed more than 24 hours ago.

So the solution I've in mind is the following:
- on the second system I keep the last refresh of the database in
some
extra table of this database (I can't find another "global" storage)
- when a specific controler is requested on this second system, it
checks if the database needs to be refreshed, downloads the database
from the first server and copies this over it's own database.

Is replacing the database allowed in a controler ?
Are there better solutions ?

thanks,
Stef



--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: is CAT() causing RuntimeError: maximum recursion depth exceeded in cmp ?

2014-05-09 Thread Anthony
CAT is a helper object, so you are nesting CATs inside of CATs inside of 
CATs, which is causing the recursion problem when everything has to be 
rendered. Your second approach is the way to go. Actually, you can skip 
making a separate list and instead just do:

table = TABLE()
for row in ...:
table.append(TR(...))

Anthony

On Friday, May 9, 2014 3:56:20 PM UTC-4, SimonD wrote:
>
> Hi,
> I would like to seek knowledge/expertise.
>
> I have this function - which shows "all user activity in the previous 90 
> days"
> def all_activity():
> 
> tabledata=TR(B('Date/Time'),B('User'),B('Activity'),_style='background-color:lightblue;')
>   
> #formatted header
> for row in 
> db(db.activity.date_time>datetime.datetime.today()-datetime.timedelta(days=91)).select(db.activity.date_time,
> db.activity.user_email,db.activity.activity, 
> orderby=~db.activity.date_time):
>
> tabledata=CAT(tabledata,TR(TD(row.date_time.strftime('%d %b %Y, 
> (%H:%M %p)'),_style='white-space:nowrap;'),row.user_email,row.activity))
> #using CAT() to build the rows
>
> return dict(rows=TABLE(tabledata)) 
>
> Although it may seem an unusual way to create a table (is it?), it 
> works. except that when I get to about 350 records I get this error:
>
> RuntimeError: maximum recursion depth exceeded in cmp
>
>
> After some elimination-testing, it seems the CAT() helper is at the root 
> of the issue
>
> If the function is written like this:
> def all_activity():
> tabledata=[]
> 
> tabledata.append(TR(B('Date/Time'),B('User'),B('Activity'),_style='background-color:lightblue;'))
> for row in 
> db(db.activity.date_time>datetime.datetime.today()-datetime.timedelta(days=91)).select(db.activity.date_time,
> db.activity.user_email,db.activity.activity, 
> orderby=~db.activity.date_time):
> 
> tabledata.append(TR(TD(row.date_time.strftime('%d %b %Y, (%H:%M 
> %p)'),_style='white-space:nowrap;'),row.user_email,row.activity))
> #essentialy using a tuple instead of CAT()
>
> return dict(rows=TABLE(tabledata)) 
>
> ...the error appears to go away.
> Yes - I know that the second verion of the function (using tuples) is a 
> better way - it was just that I was taken by surprise with the error.
>
> My function is not recursive, but raising a recursive exception.
>
> So, I want to get the view of experts why the CAT() helper would be 
> causing the problem?
> Essentially, is re-iterating CAT() causing a recursive issue?
>
> If so, is there a way to make the CAT() helper work in this scenario?
>
> BTW - this is on 2.9.5+rocket+sqlite. I also have the issue with 
> 2.9.5+apaches+mod_wsgi
> I saw a note one this forums that claims a move to MySQL would solve the 
> error. But I am note sure I have exactly the same symptoms and scenario.
>
> Thanks for the guidance.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] color cells based on value in SQLFORM

2014-05-09 Thread LoveWeb2py
Hello,

I have a spreadsheet of items and I want to track their inventory based on 
color (similar to an excel spreadsheet).

I have two columns for example: Item, Item_Status
The item could be a desk, chair, etc... and for status I have 1 2 or 3.

If the status is 1 I would like to make the cell color of the desk green, 2 
yellow, 3 red.

so far I have 

def represent_colored(value):
   if value == 1:
   return SPAN(value,_style="background-color:green',)
elif value == 2:
   return SPAN(value,_style="background-color:yellow',)
elif value == 3:
   return SPAN(value,_style="background-color:red',)
else:
   return SPAN(value,_style="background-color:orange',)

def inventory():
   db.inventory.items.represent = lambda value, row: 
represent_colored(value)
   grid=SQLFORM.grid(db.inventory, paginate=20)
   return dict(grid=grid)

This works so far, but it only changes the background color of the text in 
the status column and I want to change the column of the actual item. I 
also would like to change the entire cell  instead of just the 
background behind the text.
Also, I plan on branching the inventory out to multiple columns and I have 
two questions:

1) How could I change the entire cell color?
2) Is making multiple "status" columns the most efficient and pythonic way 
to accomplish this.

You guys are the best!


Wil
   

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: is it allowed/possible to replace the database within a controler ?

2014-05-09 Thread Anthony
Sure, it should be allowed, but nothing will be returned to the browser 
while you're waiting for the copy to happen. If the copy takes too long, 
the HTTP request may time out.

Anthony

On Friday, May 9, 2014 4:17:05 PM UTC-4, aapaap wrote:
>
>  thanks Anthony,
>
> Thought it was difficult to generate a scheduled task. But in 
> PythonAnyWhere it'standard available. So I'll go that way.
>
> Still wondering if it's allowed to copy the default web2py database in a 
> controler function ?
>
> cheers,
> Stef
>
> On 09-05-14 0:02, Anthony wrote:
>  
> You probably don't want a web request to potentially have to wait for a 
> database copy over the network before returning a result. It would probably 
> make more sense to set up a scheduled task to replicate the database once a 
> day. Or better yet, look into the replication options offered by your RDBMS 
> (e.g., http://www.postgresql.org/docs/9.3/static/high-availability.html).
>
> Anthony
>
> On Thursday, May 8, 2014 4:30:03 PM UTC-4, aapaap wrote: 
>>
>> hello, 
>>
>> I've a web2py site, which should run, more or less synchronized, (with 
>> the same data)  on 2 different servers. 
>>
>> The first one is filling the database. 
>>
>> The second one should copy the db from the first one if the database was 
>> refreshed more than 24 hours ago. 
>>
>> So the solution I've in mind is the following: 
>> - on the second system I keep the last refresh of the database in some 
>> extra table of this database (I can't find another "global" storage) 
>> - when a specific controler is requested on this second system, it 
>> checks if the database needs to be refreshed, downloads the database 
>> from the first server and copies this over it's own database. 
>>
>> Is replacing the database allowed in a controler ? 
>> Are there better solutions ? 
>>
>> thanks, 
>> Stef 
>>
>  
>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: is CAT() causing RuntimeError: maximum recursion depth exceeded in cmp ?

2014-05-09 Thread SimonD
Anthony, thanks for the quick reply. Very appreciated.
That confirms my suspicions. Thanks also for the alternative code.
Simon


On Friday, May 9, 2014 9:18:53 PM UTC+1, Anthony wrote:
>
> CAT is a helper object, so you are nesting CATs inside of CATs inside of 
> CATs, which is causing the recursion problem when everything has to be 
> rendered. Your second approach is the way to go. Actually, you can skip 
> making a separate list and instead just do:
>
> table = TABLE()
> for row in ...:
> table.append(TR(...))
>
> Anthony
>
> On Friday, May 9, 2014 3:56:20 PM UTC-4, SimonD wrote:
>>
>> Hi,
>> I would like to seek knowledge/expertise.
>>
>> I have this function - which shows "all user activity in the previous 90 
>> days"
>> def all_activity():
>> 
>> tabledata=TR(B('Date/Time'),B('User'),B('Activity'),_style='background-color:lightblue;')
>>   
>> #formatted header
>> for row in 
>> db(db.activity.date_time>datetime.datetime.today()-datetime.timedelta(days=91)).select(db.activity.date_time,
>> db.activity.user_email,db.activity.activity, 
>> orderby=~db.activity.date_time):
>>
>> tabledata=CAT(tabledata,TR(TD(row.date_time.strftime('%d %b %Y, 
>> (%H:%M %p)'),_style='white-space:nowrap;'),row.user_email,row.activity))
>> #using CAT() to build the rows
>>
>> return dict(rows=TABLE(tabledata)) 
>>
>> Although it may seem an unusual way to create a table (is it?), it 
>> works. except that when I get to about 350 records I get this error:
>>
>> RuntimeError: maximum recursion depth exceeded in cmp
>>
>>
>> After some elimination-testing, it seems the CAT() helper is at the root 
>> of the issue
>>
>> If the function is written like this:
>> def all_activity():
>> tabledata=[]
>> 
>> tabledata.append(TR(B('Date/Time'),B('User'),B('Activity'),_style='background-color:lightblue;'))
>> for row in 
>> db(db.activity.date_time>datetime.datetime.today()-datetime.timedelta(days=91)).select(db.activity.date_time,
>> db.activity.user_email,db.activity.activity, 
>> orderby=~db.activity.date_time):
>> 
>> tabledata.append(TR(TD(row.date_time.strftime('%d %b %Y, (%H:%M 
>> %p)'),_style='white-space:nowrap;'),row.user_email,row.activity))
>> #essentialy using a tuple instead of CAT()
>>
>> return dict(rows=TABLE(tabledata)) 
>>
>> ...the error appears to go away.
>> Yes - I know that the second verion of the function (using tuples) is a 
>> better way - it was just that I was taken by surprise with the error.
>>
>> My function is not recursive, but raising a recursive exception.
>>
>> So, I want to get the view of experts why the CAT() helper would be 
>> causing the problem?
>> Essentially, is re-iterating CAT() causing a recursive issue?
>>
>> If so, is there a way to make the CAT() helper work in this scenario?
>>
>> BTW - this is on 2.9.5+rocket+sqlite. I also have the issue with 
>> 2.9.5+apaches+mod_wsgi
>> I saw a note one this forums that claims a move to MySQL would solve the 
>> error. But I am note sure I have exactly the same symptoms and scenario.
>>
>> Thanks for the guidance.
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: is it allowed/possible to replace the database within a controler ?

2014-05-09 Thread Stef Mientki

thanks Anthony.

On 09-05-14 22:22, Anthony wrote:
Sure, it should be allowed, but nothing will be returned to the 
browser while you're waiting for the copy to happen. If the copy takes 
too long, the HTTP request may time out.


Anthony

On Friday, May 9, 2014 4:17:05 PM UTC-4, aapaap wrote:

thanks Anthony,

Thought it was difficult to generate a scheduled task. But in
PythonAnyWhere it'standard available. So I'll go that way.

Still wondering if it's allowed to copy the default web2py
database in a controler function ?

cheers,
Stef

On 09-05-14 0:02, Anthony wrote:

You probably don't want a web request to potentially have to wait
for a database copy over the network before returning a result.
It would probably make more sense to set up a scheduled task to
replicate the database once a day. Or better yet, look into the
replication options offered by your RDBMS (e.g.,
http://www.postgresql.org/docs/9.3/static/high-availability.html
).

Anthony

On Thursday, May 8, 2014 4:30:03 PM UTC-4, aapaap wrote:

hello,

I've a web2py site, which should run, more or less
synchronized, (with
the same data)  on 2 different servers.

The first one is filling the database.

The second one should copy the db from the first one if the
database was
refreshed more than 24 hours ago.

So the solution I've in mind is the following:
- on the second system I keep the last refresh of the
database in some
extra table of this database (I can't find another "global"
storage)
- when a specific controler is requested on this second
system, it
checks if the database needs to be refreshed, downloads the
database
from the first server and copies this over it's own database.

Is replacing the database allowed in a controler ?
Are there better solutions ?

thanks,
Stef



--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: sqltable and aggregrate function

2014-05-09 Thread peteb3100
Done: see http://code.google.com/p/web2py/issues/detail?id=1932
Hope this helps. If you need more information please let me know..

And, Massimo and all other contributors: thanks a lot for Web2py framework!
It's really such a gem...


Am Mittwoch, 7. Mai 2014 23:44:39 UTC+2 schrieb Massimo Di Pierro:
>
> This is probably a bug. Can you open a ticket about this?
>
> On Tuesday, 6 May 2014 16:04:17 UTC-5, pete...@gmail.com wrote:
>>
>> No one? Any hints on how to further debug this issue?
>>
>> Am Samstag, 3. Mai 2014 19:08:06 UTC+2 schrieb pete...@gmail.com:
>>>
>>> It just shows the created_year column, count column is missing 
>>> completly.. (Not even a table header is shown for the count column)
>>>
>>> Am Samstag, 3. Mai 2014 14:45:29 UTC+2 schrieb Niphlod:

 what does {{=stats}} show ?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web2py isn't loading my custom css file

2014-05-09 Thread ari northage-orr
Hey Everyone,

So I'm working on a website for a few friends who make music together and I 
have a custom css file I'm trying to add and for some reason web2py isn't 
loading it, or at least the styles in the file are not being applied. Here 
are the details:

The file is called wholeteam.css

my layout.html where I tell it to import my css file looks like this:

 
  {{
  response.files.insert(0,URL('static','css/web2py.css'))
  response.files.insert(1,URL('static','css/bootstrap.min.css'))
  response.files.insert(2,URL('static','css/bootstrap-responsive.min.css'))
  response.files.insert(3,URL('static','css/web2py_bootstrap.css'))
  response.files.insert(4,URL('static','css/wholeteam.css'))
  }}

  {{include 'web2py_ajax.html'}}

rest of layout.html is here


my wholeteam.css file looks like:

.member-frame{
border: 3px solid #FF;
background: blue;
width: auto;
height: auto;
}

I then try and apply the styles to a div in my views/the_team.html: 

{{extend 'layout.html'}}
The WholeTeam Crew

{{for member in members:}}

{{=member.name}}

{{=member.bio}}

{{pass}}

For some reason the styles are not being applied. Does anyone know why this 
might be happening? Admittedly I'm pretty new to CSS and HTML5 so it could 
be a simple mistake I'm making out of ignorance. 
I've inserted an image below so you can see what the page looks like when I 
load it, any help would be greatly appreciated.

Thanks,
-Ari 








-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] T.accepted_language shows nl instead of nl_NL

2014-05-09 Thread Stefan van den Eertwegh
Does anybody know how this happened?

T.accepted_language shows nl instead of nl_NL

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py report pdflatex template

2014-05-09 Thread Peter Pan
Ok, i find a  way to work with the template and it works well:

I use this code in web2py:

def print_task():
  task = db.task(request.args(0,cast=int))
  from gluon.contrib.markmin.markmin2pdf import latex2pdf
  template = 
open('//home/user/web2py/applications/Tagesaufgaben/tex/tex/templatee.tex','r').read()
 
# check path
  latex = template.format(status=task.status) # args of the dbase
  pdf, warning, errors = latex2pdf(latex)
  if errors: pass # log errors
  response.headers['Content-Type'] = 'application/pdf'
  return pdf

And this code in the template.tex

 \documentclass{{article}} 

\begin{{document}}

{status}

\end{{document}}


thanks for help Massimo




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to make SQLFORM generate INPUT type as 'date' instead 'text'

2014-05-09 Thread José Antonio Salazar Montenegro
My field is defined in db.py as
Field('mydate', type='date', requires=IS_DATE(format=T('%Y-%m-%d'))),

Using a custom FORM() I only need to do this:
INPUT(_type='date', _name='mydate')

To generate a great YMD INPUT with pop-up calendar and selectable date 
parts:

...

...


Now I want to use SQLFORM instead of FORM, but it generates the INPUT as 
text:

...

...



How can I make SQLFORM to generate INPUT type as date instead of text?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py report pdflatex template

2014-05-09 Thread Peter Pan
thanks!
web2py create very good  the pdf with the template.tex but without args in 
the pdf.

Its right that i have to create a class like this:
class LaTeXTemplate(string.Template):
delimiter = "%%"

Or understand the markmin a special operator to insert the args?

My template.tex is:

 \documentclass{article} 

\begin{document} 

The task is: $$args

\end{document}


Am Mittwoch, 7. Mai 2014 20:59:29 UTC+2 schrieb Massimo Di Pierro:
>
>
>
> On Wednesday, 7 May 2014 13:37:25 UTC-5, Peter Pan wrote:
>>
>> Hey Massimo,
>>
>> i follwo the link, read the manual and download your markmin-app,
>> but i could not find the answer - sorry iam a beginner in web2py.
>>
>> Look, i have a grid with a Button "print" :
>>
>> grid = SQLFORM.grid(query, 
>> orderby=~db.task.modified_on,create=False,details=False,editable=False,
>>  lambda row: A('print',_href=(URL('print_task',args=row.id
>> ),_class="btn"))
>>
>
> You need this:
>
> def print_task():
>   task = db.task(request.args(0,cast=int))
>   from gluon.contrib.markmin.markmin2pdf import latex2pdf
>   template = open('yourtemplate.tex','r').read() # check path
>   latex = template % task # or something similar
>   pdf, warning, errors = latex2pdf(latex)
>   if errors: pass # log errors
>   response.headers['Content-Type'] = 'application/pdf'
>   return pdf
>  
>
>>
>> and i have a template = "template.tex"
>>
>>
>> But i do not know - how i connect the button "print" with the markmin and 
>> i do not know how i implement the "template.tex."
>>
>> can you help me?
>>
>>
>> Am Dienstag, 6. Mai 2014 15:14:33 UTC+2 schrieb Massimo Di Pierro:
>>>
>>> Look into this file:
>>>
>>>
>>> https://github.com/web2py/web2py/blob/master/gluon/contrib/markmin/markmin2pdf.py
>>>
>>> there is a function markmin2pdf that uses markmin2latex and then calls 
>>> pdflatex. Only a subset of markmin is supported. Formulas go in between 
>>> $$...$$ in markmin.
>>>
>>> Massimo
>>>
>>>
>>> On Monday, 5 May 2014 14:29:34 UTC-5, Peter Pan wrote:

 Hey 
 I' m a teacher and work with pdflatex. I think its a good idea to learn 
 LaTeX with web2py.
 The Students create theire own reports with pdflatex. 
 I do Not know how to implement a pdflatex-Template in web2py. I read the 
 informations about markmin
 But i couldn' t find the answer. 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL software for win 64bit and python 2.7 64 bit

2014-05-09 Thread Rafael Santos
Have all versions
 

> PIL-1.1.7.win-amd64-py2.x installers are available at 

 

> http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: configuring routes for web2py behind reverse proxy

2014-05-09 Thread Peter Lai
To your Apache config

On Sunday, April 13, 2014 1:24:20 PM UTC-4, Jason Lee wrote:
>
> What file am I supposed to add this to?
>
> default, weby2py, default-sll?
>
> On Thursday, November 14, 2013 6:48:05 PM UTC-5, DeanK wrote:
>>
>> For anyone in the future trying to do this with Apache2 on Ubuntu:
>>
>> ProxyHTMLInterp On
>> LogLevel Debug
>> ProxyHTMLLogVerbose On
>> ProxyPass /link/ http://my.server.com/
>> ProxyPassReverse /link/ http://my.server.com/
>>
>> ProxyHTMLURLMap http://my.server.com /link/
>>
>> 
>>   ProxyPassReverse /
>>   SetOutputFilter  proxy-html
>>   ProxyHTMLURLMap http://my.server.com /link/
>>   ProxyHTMLURLMap / /link/
>>   ProxyHTMLURLMap  /link/ /link/
>>   RequestHeaderunset  Accept-Encoding
>> 
>>
>>
>>
>> On Tuesday, November 5, 2013 11:51:11 AM UTC-5, DeanK wrote:
>>>
>>> I have an instance of web2py running on nginx sitting behind an apache 
>>> reverse proxy (soon to be nginx as well) so:
>>>
>>> www.mydomain.com/myapppoints to >>myserver1.otherdomain.com
>>>
>>> i have /myapp/default/landing set as the default application, 
>>> controller, and function.  When i go directly to 
>>> myserver1.otherdomain.com everything is fine, but if i go to 
>>> www.mydomain.com/myapp all of my static files are unreachable because 
>>> the relative paths point to www.mydomain.com/myapp/static/file where 
>>> really it would have to be www.mydomain.com/myapp/myapp/static/filewhich is 
>>> kind of ugly.  I am using URL() to create relative links.
>>>
>>> I first though maybe the fact the the reverse proxy url and app names 
>>> are the same was confusing regex or whatever was doing the rewrites, but 
>>> that didn't seem to be the case.  I also started looking at routes.py and 
>>> set BASE = 'myapp'.  That made parts of my site work, but things like login 
>>> then didn't.
>>>
>>>
>>> Anyone have experience setting a web2py app up behind a reverse proxy? 
>>>  Thoughts? Thanks,
>>>
>>> Dean
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] DAL: How to check for empty list:string when using mongodb

2014-05-09 Thread Juan Luis
This is in relation to 
http://stackoverflow.com/questions/23367218/web2py-dal-how-to-check-liststring-type-items-for-none

Answer works when tested on sqlite but does not work for Mongodb

In [4]: db.Tasks.email != [ ]

Creates the mongo query :

Out[4]: 


In mongo shell:

> db.Tasks.find().count()
1195 < total number of records.

> db.Tasks.find({'email': {'$ne': ' ' }}).count()
1195 

The correct query should be:

>db.Tasks.find({email: {$ne: [ ] }}).count()
108


But looks like the DAL is converting empty list to empty string instead. Is 
there anyway to force the DAL to retain the empty list when handed off to 
mongodb?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] question about video

2014-05-09 Thread eric cuver
Hi, 
I'm beginning to web2py, 

I would like to create a site that allows people to register on the site 
to be able to record their webcam and put the video 
on the account and customizes video will be viewed 
by people who have the right. how do you function module or with web2py I 
happen to create this site 
thank you in advance and excuse my english I'm french

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to run arbitrary scripts within the web2py environment?

2014-05-09 Thread Spencer Underwood
Sorry for the delay in replying, I added a reply to this yesterday but it 
doesn't appear to have gone through for some reason. On the other hand, if 
this is a duplicate of yesterdays post feel free to ignore it.

What I mean by running in the web2py environment is having access to the 
features such as DAL and Auth to run test code and print the results to a 
console. You are completely right in that this particular use of testing 
things to see how it works doesn't need to be in an MVC framework, but if I 
can get the test code working properly I intended to move it into a module 
and import it at a controller somewhere. 

After looking a bit more, I noticed there was two command line options 
(--shell=APPNAME 
and --run=PYTHON_FILE ) which might be what I'm looking for. I'll give it a 
shot over this weekend to see if it works as I hope it does.


On Wednesday, 7 May 2014 18:01:38 UTC-4, Niphlod wrote:
>
> ok. now you just have to explain what do you mean by "running in web2py 
> environment". 
> If you don't want to use models or controllers (and surely do not want 
> views), why do you need an MVC (Model-View-Controller) framework 
> environment to work in? 
>
> On Wednesday, May 7, 2014 10:38:52 PM UTC+2, Spencer Underwood wrote:
>>
>>
>> Greetings,
>>
>> This might be a really dumb or simple question or might better suited to 
>> ask in the IRC channel, but I can't seem to find an answer to this anywhere 
>> on google. I've been trying to test various bits of code to see how it runs 
>> on the web2py framework but without tying it to a specific view. Does 
>> anyone know how to run a script / function in a module based off of events 
>> such as a button press or a input command to the web shell?
>>
>> I made a simple function in a module which, provided a valid API Key, 
>> Verification Code and Character ID, parses and stores a list of mail 
>> messages pulled from the 
>> MailMessagefunction made 
>> available by the EVE Online API Server. There is also a 
>> function which will do the same as before but for every valid API Key, 
>> Verification Code and Character ID stored in the database all at once. I'm 
>> working on a means to properly handle the other API calls 
>> availableand would like to run 
>> those on a semi-regular basis, but haven't currently 
>> achieved a working result yet. I intended to invoke these method when a 
>> user logs into the site, as well as roughly once every twelve hours, to 
>> keep a relatively up-to-date database filled with mails for EVE Online. 
>>
>> All relevant ID columns for things like Character ID, Message ID, etc... 
>> from the API server are unique so a quick IS_NOT_IN_DB and a unique key 
>> constraint should stop any and all duplicates. I guess later I could log 
>> attempts to enter a duplicate value, but right now it's not a concern. 
>>
>> From my understanding, any code in the Model or Controller folders will 
>> be executed each time the page is viewed. This works well for a lot of 
>> things, but doesn't seem optimal for relatively slow net and database code. 
>> The Scheduler seems like it could be useful for this, but that doesn't seem 
>> like it should be placed in a model or a controller file.
>>
>> Here is what I've used so far to read messages and pull them to a 
>> database, it's pretty crude but I just wanted a working example to build 
>> off of later.
>>
>> the EVE API class is a python library (found 
>> here) 
>> which does the job of parsing the XML data returned from the API server 
>> into an iterable data structure. 
>>
>> # Put your userID and apiKey (full access) here before running this 
>> script.
>> YOUR_KEYID = [redacted]
>> YOUR_VCODE = "[redacted]"
>> YOUR_CHARACTERID=[redacted]
>>
>> from os.path import join, exists
>> from httplib import HTTPException
>> from gluon.sql import DAL, Field
>> from gluon.validators import *
>>
>> import logging
>>
>> import eveapi
>> import datetime
>>
>> api = eveapi.EVEAPIConnection()
>> db = DAL('sqlite://test3.sqlite')
>>
>> #
>> message = db.define_table('message', 
>> Field('messageID','integer', unique=True),
>> Field('header','string'),Field('body','string'), 
>> Field('dateTimeSent','datetime'))
>>
>> #/account/Characters.xml.aspx
>> getMailHeader = api("/char/MailMessages", keyID=YOUR_KEYID, 
>> vCode=YOUR_VCODE, characterID=YOUR_CHARACTERID)
>>
>> listOfMessageID = []
>> listOfHeaders = []
>>
>> result = getMailHeader.messages.SortedBy("sentDate")
>> for s in result:
>> try:
>> db.message.insert(messageID=s.get("messageID"), header=s.get("title"), 
>> dateTimeSent = datetime.datetime.utcfromtimestamp( s.get("sentDate") ) , 
>> body="")
>> listOfMessageID.append(s.get("messageID"))
>> except Exception as e:
>> logging.warning("Message with ID of %s already exists in database", 

[web2py] Re: How to run arbitrary scripts within the web2py environment?

2014-05-09 Thread Spencer Underwood
I'm not very good at putting into words what I'm thinking, so I do 
apologize for not being very clear.

I was hoping there might be a way to do "one-off" type scripts using the 
DAL and Auth features to test code that can print to a console. You are 
right, for this particular use case an MVC framework isn't needed since 
it's not web related at all. 

Yesterday the only way I knew how to do such a thing was by running the 
py.exe executable with an argument for the file you wanted to run, but that 
doesn't seem to work on non-windows platforms. After looking into it a bit 
more today, the --run=PYTHON_FILE argument available from command line 
might be what I need.

Thanks for the tip the other day, by the way, it was a pretty simple 
question and setting migrate=False worked perfectly.

On Wednesday, 7 May 2014 18:01:38 UTC-4, Niphlod wrote:
>
> ok. now you just have to explain what do you mean by "running in web2py 
> environment". 
> If you don't want to use models or controllers (and surely do not want 
> views), why do you need an MVC (Model-View-Controller) framework 
> environment to work in? 
>
> On Wednesday, May 7, 2014 10:38:52 PM UTC+2, Spencer Underwood wrote:
>>
>>
>> Greetings,
>>
>> This might be a really dumb or simple question or might better suited to 
>> ask in the IRC channel, but I can't seem to find an answer to this anywhere 
>> on google. I've been trying to test various bits of code to see how it runs 
>> on the web2py framework but without tying it to a specific view. Does 
>> anyone know how to run a script / function in a module based off of events 
>> such as a button press or a input command to the web shell?
>>
>> I made a simple function in a module which, provided a valid API Key, 
>> Verification Code and Character ID, parses and stores a list of mail 
>> messages pulled from the 
>> MailMessagefunction made 
>> available by the EVE Online API Server. There is also a 
>> function which will do the same as before but for every valid API Key, 
>> Verification Code and Character ID stored in the database all at once. I'm 
>> working on a means to properly handle the other API calls 
>> availableand would like to run 
>> those on a semi-regular basis, but haven't currently 
>> achieved a working result yet. I intended to invoke these method when a 
>> user logs into the site, as well as roughly once every twelve hours, to 
>> keep a relatively up-to-date database filled with mails for EVE Online. 
>>
>> All relevant ID columns for things like Character ID, Message ID, etc... 
>> from the API server are unique so a quick IS_NOT_IN_DB and a unique key 
>> constraint should stop any and all duplicates. I guess later I could log 
>> attempts to enter a duplicate value, but right now it's not a concern. 
>>
>> From my understanding, any code in the Model or Controller folders will 
>> be executed each time the page is viewed. This works well for a lot of 
>> things, but doesn't seem optimal for relatively slow net and database code. 
>> The Scheduler seems like it could be useful for this, but that doesn't seem 
>> like it should be placed in a model or a controller file.
>>
>> Here is what I've used so far to read messages and pull them to a 
>> database, it's pretty crude but I just wanted a working example to build 
>> off of later.
>>
>> the EVE API class is a python library (found 
>> here) 
>> which does the job of parsing the XML data returned from the API server 
>> into an iterable data structure. 
>>
>> # Put your userID and apiKey (full access) here before running this 
>> script.
>> YOUR_KEYID = [redacted]
>> YOUR_VCODE = "[redacted]"
>> YOUR_CHARACTERID=[redacted]
>>
>> from os.path import join, exists
>> from httplib import HTTPException
>> from gluon.sql import DAL, Field
>> from gluon.validators import *
>>
>> import logging
>>
>> import eveapi
>> import datetime
>>
>> api = eveapi.EVEAPIConnection()
>> db = DAL('sqlite://test3.sqlite')
>>
>> #
>> message = db.define_table('message', 
>> Field('messageID','integer', unique=True),
>> Field('header','string'),Field('body','string'), 
>> Field('dateTimeSent','datetime'))
>>
>> #/account/Characters.xml.aspx
>> getMailHeader = api("/char/MailMessages", keyID=YOUR_KEYID, 
>> vCode=YOUR_VCODE, characterID=YOUR_CHARACTERID)
>>
>> listOfMessageID = []
>> listOfHeaders = []
>>
>> result = getMailHeader.messages.SortedBy("sentDate")
>> for s in result:
>> try:
>> db.message.insert(messageID=s.get("messageID"), header=s.get("title"), 
>> dateTimeSent = datetime.datetime.utcfromtimestamp( s.get("sentDate") ) , 
>> body="")
>> listOfMessageID.append(s.get("messageID"))
>> except Exception as e:
>> logging.warning("Message with ID of %s already exists in database", 
>> s.get("messageID"))
>>
>> if len(listOfMessageID) > 0:
>> g

[web2py] Re: Bootstrap3 package - help to test

2014-05-09 Thread pjryan126
I'm using this in a project now and I even have it working on IE 8. Thanks, 
Paolo!

The only thing I have had to do so far is to add "li_active='active' to 
bs3.menu():

menu = MENU(current_menu,
_class='nav %s' % menu_class,
li_active='active',
li_class='dropdown',
ul_class='dropdown-menu')


On Monday, December 23, 2013 3:20:48 PM UTC-5, Paolo Caruccio wrote:
>
> I just completed a package that applies the bootstrap3 style to some 
> web2py elements - the current version covers the navigation menus, the auth 
> navbar and SQLFORMs (via formstyle) - but I need your help for testing it.
>
> The package includes the following files:
>
>  - bootstrap3.py
>  - web2py-bootstrap3.css
>  - web2py-bootstrap3.js
>  - example of layout.html
>  - a readme file containing the istallation and usage instructions
>  - license (please report if the license is right for a future inclusion 
> in web2py)
>
> Here attached some screenshots and a web2py app with examples. 
>
> Thank you in advance for your feedbacks, suggestions for optimizing the 
> code and any additions and everything else useful to improve the package.
>
> Marry Christmas. 
>
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: question about video

2014-05-09 Thread Massimo Di Pierro
The only thing that you need that does not ship with web2py is a way to 
record their video and upload to your side.

Some options include:
- http://www.webrtc.org/
- http://www.screencast-o-matic.com/

Massimo

On Thursday, 8 May 2014 13:59:19 UTC-5, eric cuver wrote:
>
> Hi, 
> I'm beginning to web2py, 
>
> I would like to create a site that allows people to register on the site 
> to be able to record their webcam and put the video 
> on the account and customizes video will be viewed 
> by people who have the right. how do you function module or with web2py I 
> happen to create this site 
> thank you in advance and excuse my english I'm french
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: T.accepted_language shows nl instead of nl_NL

2014-05-09 Thread Massimo Di Pierro
Which app? Perhaps we do not have a nl_NL.py file.

On Thursday, 8 May 2014 09:21:01 UTC-5, Stefan van den Eertwegh wrote:
>
> Does anybody know how this happened?
>
> T.accepted_language shows nl instead of nl_NL
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] OPTION helper - custom class for the drop down

2014-05-09 Thread greenpoise
How can I add a custom class for a drop down?

 {{=SELECT(*[OPTION(r.detail,_value=r.id) for r in row.inventory],**dict(
_name='id'))}}


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: What is a clear procedure to style web2py css files using Bootstrap theme generators/choosers?

2014-05-09 Thread LightDot
As far as Bootswatch 2 themes are concerned, the original, stock 
bootstrap-responsive.min.css must be loaded if you wish your page to be 
"responsive". Bootswatch 2 themes do not provide this functionality. So, 
regardless of the Bootswatch 2 theme used, they can all co-exist with the 
same, stock bootstrap-responsive.min.css.

What bootstrap-responsive.min.css does is explained in the old Bootstrap 2 
docs, for example here: 
http://getbootstrap.com/2.3.2/scaffolding.html#responsive and you can just 
try how your page looks with or without it. Just to be clear - you don't 
have to use the responsive features or even load the 
bootstrap-responsive.min.css, it's optional.

Regards

On Friday, May 9, 2014 5:24:23 PM UTC+2, JoeCodeswell wrote:
>
> Dear LightDot and Ari,
>
> Thanks for the responses. The situation is getting clearer in my mind.
>
> I have some follow-on questions for LightDot. You said:
>
> Details such as whether you need to replace just bootstrap.min.css (and 
>> keep the original bootstrap-responsive.min.css) or replace the 
>> bootstrap.min.css and remove bootstrap-responsive.min.css altogether, are 
>> going to be stated in the documentation of the theme / project you're 
>> switching to.
>
>
> I am sure you know WAY more about the history of Bootstrap and its 
> documentation than I do. I went to http://bootswatch.com/2/ and looked at 
> the Cerulean Preview, which seems to me to be the "the documentation of the 
> theme". I did a firefox page search for "responsive". Result: "Phrase not 
> found".
>
> Here are my questions, LightDot. Thanks in advance for educating me.
>
> Does every Bootstrap2 theme have a *correspondingly 
> developed*bootstrap-responsive.min.css? I assume the answer to this is NO.
>
> Will every Bootstrap2 theme work with a *separately 
> developed*bootstrap-responsive.min.css?
>
> Will the web2py default bootstrap-responsive.min.css "work" with any 
> Bootstrap2 theme's bootstrap.min.css? If, YES, generally what will the 
> result look like, when the bootstrap-responsive.min.css is in control?
>
> Thanks again, LightDot and Ari.
>
> Love and peace,
>
> Joe
>
> On Wednesday, May 7, 2014 11:57:54 AM UTC-7, ari northage-orr wrote:
>>
>> LightDot is correct, this is due to the fact that web2py comes with 
>>> bootstrap 2. I had the exact same issue as you, I was trying to use a theme 
>>> from Bootswatch and it ended up breaking the navbar and messing up the 
>>> placement of things on my page. Googling themes for bootstrap 2 and using 
>>> one of those fixed the issue completely. 
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: color cells based on value in SQLFORM

2014-05-09 Thread Anthony
Might be easiest to do this with Javascript in the browser. You can also 
manipulate the grid DOM on the server -- maybe something like this:

colors = {1: 'green', 2: 'yellow', 3: 'red'}
grid = SQLFORM.grid(...)
table = grid.element('.web2py_table')
if table:
[td.update(_style='background: ' + colors.get(td[0], 'orange'))
 for td in table.elements('td')]

That may be a bit slow because it must traverse the whole table to find the 
TDs and then iterate over the TDs to update their attributes.

Anthony

On Friday, May 9, 2014 4:22:45 PM UTC-4, LoveWeb2py wrote:
>
> Hello,
>
> I have a spreadsheet of items and I want to track their inventory based on 
> color (similar to an excel spreadsheet).
>
> I have two columns for example: Item, Item_Status
> The item could be a desk, chair, etc... and for status I have 1 2 or 3.
>
> If the status is 1 I would like to make the cell color of the desk green, 
> 2 yellow, 3 red.
>
> so far I have 
>
> def represent_colored(value):
>if value == 1:
>return SPAN(value,_style="background-color:green',)
> elif value == 2:
>return SPAN(value,_style="background-color:yellow',)
> elif value == 3:
>return SPAN(value,_style="background-color:red',)
> else:
>return SPAN(value,_style="background-color:orange',)
>
> def inventory():
>db.inventory.items.represent = lambda value, row: 
> represent_colored(value)
>grid=SQLFORM.grid(db.inventory, paginate=20)
>return dict(grid=grid)
>
> This works so far, but it only changes the background color of the text in 
> the status column and I want to change the column of the actual item. I 
> also would like to change the entire cell  instead of just the 
> background behind the text.
> Also, I plan on branching the inventory out to multiple columns and I have 
> two questions:
>
> 1) How could I change the entire cell color?
> 2) Is making multiple "status" columns the most efficient and pythonic way 
> to accomplish this.
>
> You guys are the best!
>
>
> Wil
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] represent in form field

2014-05-09 Thread 黄祥
hi,

is it possible to make represent work in form field?
e.g.
db.product.price.represent = lambda price, field: format(price, 
",d").replace(",", ".")

this work only in view, not in the form field, my expectation is when user 
input the price in input field they will have . for thousand separated, 
e.g. in form field 1.000
how can achieve that in web2py way?

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to use the new cpdb.py introduced in 1.97.1?

2014-05-09 Thread Ben Lawrence
Hi,
How did you get to that stage? I get:

gluon path not found

EXCEPTION: could not make a copy of the database

global name 'DAL' is not defined

On Saturday, July 23, 2011 12:17:22 AM UTC-7, Saurabh Sawant wrote:
>
> I am having a hard time migrating data from sqlite to postgres 
>
> This is the command that I use 
>
> ./web2py.py -S testapp -M -N -R scripts/cpdb.py -A -f 
> sqlite://applications/testapp/databases/storage.sqlite -y 'sqlite:// 
> applications/testapp/databases/storage.sqlite'  -Y 'postgres:// 
> puser:ppass@localhost/testdb' 
>
> It says 
>
> web2py Web Framework 
> Created by Massimo Di Pierro, Copyright 2007-2011 
> Version 1.97.1 (2011-06-26 19:25:44) 
> Database drivers available: SQLite3, pymysql, PostgreSQL 
> EXCEPTION: could not make a copy of the database 
> Failure to connect, tried 5 times: 
> unable to open database file 
>
> Any idea how to make this work?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] thumbnails plugin

2014-05-09 Thread Carlos A. Armenta Castro
I'll try it, it was ir looking For.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to use the new cpdb.py introduced in 1.97.1?

2014-05-09 Thread mart
well, there are 2 things to look at.

1) You need to be able to import the dal.py module (located in the /gluon 
dir) to setup your connection strings 

2) just so you know, there are very few important lines of code in that 
script... Only the following matter:

# obviously, you will need to import dal
from gluon.dal import DAL

# Alternatively, you can use __import__  , something like the 
following couple of lines:

# add the path to the gluon folder in sys path
sys.path.append(os.path.abspath('./path/to/gluon'))

# next import the module
__import__('dal',globals={}, locals={}, from list['DAL',], level=0)


# now the meat of the cpdb !

# set you SOURCE and TARGET connection strings

source_db = DAL() 
   <-- we assume this instance already exists

other_db = DAL() 


# Now, you can loop through the tables of your SOURCE db and use 
*THAT* (along with its fields) to
# define your TARGET tables and fields (this takes care of you DB 
model)

for table in source_db:
other_db.define_table(
table._tablename, *[field for field in table])

# next, you want to populate your TARGET DB with the data from your 
SOURCE DB
# so the following will dump the data (from SOURCE) as CSV 
formatted lines in a file called 'temp.sql'

source_db.export_to_csv_file(open('tmp.sql', 'wb'))

# Now, the reverse needs to happen... the next line will load the 
data that was just dumped to temp.sql
# and will import it to you TARGET instance

other_db.import_from_csv_file(open('tmp.sql', 'rb'))

# Finally, you just need to commit the changes in your newly 
populated TARGET BD

other_db.commit()

Then, your done.

I hope this helps,

Mart   


On Friday, May 9, 2014 5:23:58 PM UTC-7, Ben Lawrence wrote:
>
> Hi,
> How did you get to that stage? I get:
>
> gluon path not found
>
> EXCEPTION: could not make a copy of the database
>
> global name 'DAL' is not defined
>
> On Saturday, July 23, 2011 12:17:22 AM UTC-7, Saurabh Sawant wrote:
>>
>> I am having a hard time migrating data from sqlite to postgres 
>>
>> This is the command that I use 
>>
>> ./web2py.py -S testapp -M -N -R scripts/cpdb.py -A -f 
>> sqlite://applications/testapp/databases/storage.sqlite -y 'sqlite:// 
>> applications/testapp/databases/storage.sqlite'  -Y 'postgres:// 
>> puser:ppass@localhost/testdb' 
>>
>> It says 
>>
>> web2py Web Framework 
>> Created by Massimo Di Pierro, Copyright 2007-2011 
>> Version 1.97.1 (2011-06-26 19:25:44) 
>> Database drivers available: SQLite3, pymysql, PostgreSQL 
>> EXCEPTION: could not make a copy of the database 
>> Failure to connect, tried 5 times: 
>> unable to open database file 
>>
>> Any idea how to make this work?
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.