[web2py] Regarding one Ajax call blocked by another Ajax call

2013-02-02 Thread Saransh Gupta
Hello,

I have a web-app that is running on host A, it runs a few commands on
another host B and i want to display the output of the commands running on
B on a webpage present on A i.e. i want to create a kind of live streaming
of B's console on a webpage present on A.

For this what i did is I redirected the output of B's console to a socket
on A and saved the output in a file on A.

I fire an ajax call that initiates the process(using web2py controller) to
start at B. This ajax call also handles the redirection of B's  console to
A's socket.

>From the webpage I fire another ajax that reads the file in which the data
of the socket is being stored.

Now the problem I am facing is that when I fire the secodn ajax call it
does not returns to the webpage untill the first ajax call is returned.

I want to know that is this the correct way of doing this. Also i want to
know that, the problem I am facing is due to ajax or web2py framework?

-Saransh

-- 

--- 
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/groups/opt_out.




[web2py] Re: IDE plugin what to use?

2013-02-02 Thread Massimo Di Pierro
We have tried many options in the past. We always run into issues. 
codemirror is the only one that so, so far, has not had issues. It is used 
by github and this makes me think it will have decent long term support.

Massimo

On Saturday, 2 February 2013 18:55:56 UTC-6, samuel bonilla wrote:
>
>  NINJA IDE (ninja-ide.org)
>
>
>
> El viernes, 1 de febrero de 2013 03:29:47 UTC-5, Mika Sjöman escribió:
>>
>> Hi
>>
>> I am totally new to web2py and thinking of skipping Django to get things 
>> done in Web2py instead. But - I really like working in an IDE if possible.
>>
>> Is there any Eclipse web2py plugin - I find it quite messy to add headers 
>> for every controller manually. Learned about WingIDE but I dont like non 
>> FOSS software at all. 
>>
>> Sincerely yours
>>
>> Mika
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to get an excerpt from a link

2013-02-02 Thread Massimo Di Pierro
{{form gluon.contrib.autolinks import expand_html}}
{{=XML(expand_html(your_html),cache.ram('mycachekey',lambda:dict(),3600)}}

will do what you ask. Will expand all links not already tagged using the 
oembed protocol.


On Saturday, 2 February 2013 18:33:42 UTC-6, sasogeek wrote:
>
> Not sure if I understand your question but I guess I'll say html cos 
> that's what I'm familiar with... :|
>
> On Saturday, 2 February 2013 20:44:25 UTC, Massimo Di Pierro wrote:
>>
>> It depends. In which format is the input? markmin, html?
>>
>> On Friday, 1 February 2013 22:15:13 UTC-6, sasogeek wrote:
>>>
>>> I want to do something similar to how facebook reatcs to links...
>>> let's say a user makes a post with a link in it (the post is not 
>>> necessarily just the link)
>>> i want to be able to grab the link from the post, make it clickable, as 
>>> well as a little excerpt from the contents in the page that link is 
>>> anchored to.
>>>
>>> eg.
>>>
>>> blabla bla blablalbal bla blalba blalba crap! this is a link 
>>> http://domain.com/somepage.html is a cool blog page.
>>>
>>> when a user posts the above example, i want to make 
>>> http://domain.com/somepage.html into an actual link which is clickable, 
>>> as well as show some sort of excerpt from the contents in that page... i 
>>> used fb as an example so it's easy to understand what i want to accomplish 
>>> :)
>>>
>>> help?
>>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Record versioning on delete CASCADE

2013-02-02 Thread Massimo Di Pierro
I should explain my answer. In order to have record versioning, record must 
be copied. To have a cascade delete we would have to loop and copy each 
individual record. Those records themselves could have references. More 
looping. etc. This are even more complex since there may be non-trivial 
circular references.

On Saturday, 2 February 2013 21:10:56 UTC-6, Massimo Di Pierro wrote:
>
> It is possible but very very inefficient since it would not be handled at 
> the database level.
>
> On Saturday, 2 February 2013 15:44:20 UTC-6, Felipe Meirelles wrote:
>>
>> I think they should, to be compatible with the default behaviour. Is this 
>> possible to do?
>>
>> On Saturday, February 2, 2013 6:41:25 PM UTC-2, Massimo Di Pierro wrote:
>>>
>>> Good point. No. they are not set to is_active=False. Should they?
>>>
>>> On Saturday, 2 February 2013 06:20:47 UTC-6, Felipe Meirelles wrote:

 No, I mean, when a record is "delete" aka is_active is seted to False, 
 the other records there make reference to it are seted false too?

 On Friday, February 1, 2013 6:19:52 PM UTC-2, Massimo Di Pierro wrote:
>
> When using versioning. Latest versions of records are never deleted, 
> only filtered out. I think cascade should work as expected.
>
> On Friday, 1 February 2013 11:54:25 UTC-6, Felipe Meirelles wrote:
>>
>> The cascade feature should work for record versioning enabled tables?
>>
>> Thanks.
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Record versioning on delete CASCADE

2013-02-02 Thread Massimo Di Pierro
It is possible but very very inefficient since it would not be handled at 
the database level.

On Saturday, 2 February 2013 15:44:20 UTC-6, Felipe Meirelles wrote:
>
> I think they should, to be compatible with the default behaviour. Is this 
> possible to do?
>
> On Saturday, February 2, 2013 6:41:25 PM UTC-2, Massimo Di Pierro wrote:
>>
>> Good point. No. they are not set to is_active=False. Should they?
>>
>> On Saturday, 2 February 2013 06:20:47 UTC-6, Felipe Meirelles wrote:
>>>
>>> No, I mean, when a record is "delete" aka is_active is seted to False, 
>>> the other records there make reference to it are seted false too?
>>>
>>> On Friday, February 1, 2013 6:19:52 PM UTC-2, Massimo Di Pierro wrote:

 When using versioning. Latest versions of records are never deleted, 
 only filtered out. I think cascade should work as expected.

 On Friday, 1 February 2013 11:54:25 UTC-6, Felipe Meirelles wrote:
>
> The cascade feature should work for record versioning enabled tables?
>
> Thanks.
>


-- 

--- 
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/groups/opt_out.




[web2py] Re: having a problem with the online editor

2013-02-02 Thread Niphlod
then try to install firebug in firefox and turn on the console to see the 
error in javascript (there should be one)

On Saturday, February 2, 2013 8:24:13 PM UTC+1, JFroles wrote:
>
> Hmm thanks for the tip but no luck.  Verified JavaScript in enabled as 
> well.  Tried a few other minor things like re-installing web2py but no luck 
> and it's not Chrome specific because it happens in Firefox as well.
>
>
> On Saturday, February 2, 2013 2:03:13 PM UTC-5, Niphlod wrote:
>>
>> try a ctrl+R to refresh the page refetching all the static files. That 
>> visualization should happen only when javascript is disabled, which I guess 
>> it's not your case
>>
>> On Saturday, February 2, 2013 7:17:35 PM UTC+1, JFroles wrote:
>>>
>>> Hey all!  I'm relatively new to web2py so I am guessing this is a simple 
>>> problem.  For whatever reason web2py keeps loading what I assume to be a 
>>> basic html text box instead of the actual editor (see screencap in pic) and 
>>> none of the ZenCoding bindings work.  Is there an option I am not seeing 
>>> that I changed by accident?
>>>
>>> Note: Web2py v. 2.3.2 in Chrome
>>>  running on Win 7 via Cygwin
>>>
>>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: create query for join multiple table

2013-02-02 Thread steve van christie
my purpose is to fetch all the data (company, invoices) of the user who
created the  invoices
i mean the part that make me confuse is i think
db.auth_user.company_id==company_id
is same like
db.auth_user.company_id==db.company.id
how do you think?
thank you so much for your detail explaination niphlod

-- 

--- 
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/groups/opt_out.




[web2py] Re: IDE plugin what to use?

2013-02-02 Thread samuel bonilla
 NINJA IDE (ninja-ide.org)



El viernes, 1 de febrero de 2013 03:29:47 UTC-5, Mika Sjöman escribió:
>
> Hi
>
> I am totally new to web2py and thinking of skipping Django to get things 
> done in Web2py instead. But - I really like working in an IDE if possible.
>
> Is there any Eclipse web2py plugin - I find it quite messy to add headers 
> for every controller manually. Learned about WingIDE but I dont like non 
> FOSS software at all. 
>
> Sincerely yours
>
> Mika
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: IDE plugin what to use?

2013-02-02 Thread samuel bonilla

Sublime Text 2/3 (www.sublimetext.com)! or NINJA IDE (ninja-ide.org), are 
the best options
El viernes, 1 de febrero de 2013 03:29:47 UTC-5, Mika Sjöman escribió:
>
> Hi
>
> I am totally new to web2py and thinking of skipping Django to get things 
> done in Web2py instead. But - I really like working in an IDE if possible.
>
> Is there any Eclipse web2py plugin - I find it quite messy to add headers 
> for every controller manually. Learned about WingIDE but I dont like non 
> FOSS software at all. 
>
> Sincerely yours
>
> Mika
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to get an excerpt from a link

2013-02-02 Thread sasogeek
Not sure if I understand your questions but I guess I'll say html cos 
that's what I'm familiar with... :|

On Saturday, 2 February 2013 20:44:25 UTC, Massimo Di Pierro wrote:
>
> It depends. In which format is the input? markmin, html?
>
> On Friday, 1 February 2013 22:15:13 UTC-6, sasogeek wrote:
>>
>> I want to do something similar to how facebook reatcs to links...
>> let's say a user makes a post with a link in it (the post is not 
>> necessarily just the link)
>> i want to be able to grab the link from the post, make it clickable, as 
>> well as a little excerpt from the contents in the page that link is 
>> anchored to.
>>
>> eg.
>>
>> blabla bla blablalbal bla blalba blalba crap! this is a link 
>> http://domain.com/somepage.html is a cool blog page.
>>
>> when a user posts the above example, i want to make 
>> http://domain.com/somepage.html into an actual link which is clickable, 
>> as well as show some sort of excerpt from the contents in that page... i 
>> used fb as an example so it's easy to understand what i want to accomplish 
>> :)
>>
>> help?
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: looking for volunteers to help proof-read book 5th ed.

2013-02-02 Thread wwwgong
Massimo,
Do you plan to add a section to briefly highlight the major revisions when 
the new edition of web2py book comes online?
Thanks,
Wen

On Sunday, January 20, 2013 6:52:02 PM UTC-5, Massimo Di Pierro wrote:
>
> I am looking for help proofreading the final version of the book. It is 
> almost done up to a final touch. 
>
> The attached file contains the changes between the 4th edition and 5th 
> edition (only the new text). It would be great is some native english 
> speaker could be me proof-read the changes. If you can help please edit the 
> text in place with a text editor, without adding line breaks or extra 
> spaces so I can diff the corrections. 
>
> The first two people who volunteer to help and can proof-read the attached 
> file by Saturday, will receive a free copy of the printed book as soon as 
> it is done. 
>
> Massimo 
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: RuntimeError: Unable to handle upload

2013-02-02 Thread Bill Thayer
Yes. That is what I meant.

On Saturday, February 2, 2013 1:49:55 PM UTC-6, Alan Etkin wrote:
>
> Your code also threw the same error so before I un-commented the if 
>> statements in dal.py I added some print statements
>>
>
> Did you try the store command as I posted it (passing pathname and 
> filename) without changing dal.py? What is the error output?
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: The Great Web Framework Shootout

2013-02-02 Thread OJ
Could you send it to me? Or did you mean that you don't have it anymore :)

I tried to contact the author about it, but haven't heard from him.

On Saturday, February 2, 2013 10:40:36 PM UTC+2, Massimo Di Pierro wrote:
>
> I do not recall. I do not see it there which is strange.
>
> On Saturday, 2 February 2013 05:24:05 UTC-6, OJ wrote:
>>
>> Massimo, where can I find your patch? I understood that you submitted 
>> web2py -patch for the shootout. I'm currently interested to see how hw 
>> aspect would have effect to results and I need web2py to be part of it. 
>>
>> On Monday, February 20, 2012 3:51:36 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> I did submit a patch. I also submitted a comment on reddit. Those 
>>> benchmarks are misleading. For example in Django they use the ORM but 
>>> in Flask they use native sqlite, not SQLAlchemy. In Django I think 
>>> they have sessions enabled, in Flask, I think no. 
>>>
>>> On Feb 19, 11:23 pm, Bruno Rocha  wrote: 
>>> > I did not see web2py on the list... 
>>> > Em 20/02/2012 03:03, "pbreit"  escreveu: 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > >http://blog.curiasolutions.com/the-great-web-framework-shootout/ 
>>> > >https://github.com/seedifferently/the-great-web-framework-shootout
>>
>>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: contribute: db diagram for web2py appadmin

2013-02-02 Thread Arnon Marcus
There are many problems I can detect in this solution:

1. It is a code-generator - I was aiming for a file-format parser that
implements the code, not generate it, and one that is built-into the DAL
constructor, and uses conventions. I don't really care for
auto-generated-comments, but I would like to be able to just include a line
like:
  db = DAL('db')
and then have the constructor look for a file named "db.schema.yaml" or
something - then pars it while executing the necessary directive on the
spot.
There shouldn't be any declerative code at all - it is not needed - code is
for imperative processing - not declerative.

2. It does not adhere to any standard that has support for in existing
database-schema visual designers that have a node-based GUI.
This goes with the first point - the goal should be to not have to deal
with code at all when designing the database, as again - that is a
decorative process, not an imperative one... By having the entire DAL
definition completely declarative, you can just use a GUI tool of your
choice for schema design. It can then also enable web2py to come built-in
with its own web-based application and/or appliance within the admin
application, to use for managing database schemas visually for the hosted
applications.

3. It is old and deprecated - it uses SQLFIELD...

4. The way "db" is at the same level in the hierarchy as the tabled is
un-intuitive



On Sat, Feb 2, 2013 at 1:06 PM, Jose  wrote:

>
>
> El sábado, 2 de febrero de 2013 13:30:49 UTC-3, Arnon Marcus escribió:
>
>> It may be not directly related to this topic, but I have been thinking
>> about this for a long time now:
>> Writing database schemas in python in the model is very simple and
>> decorative.
>> Why not make it a declarative format?
>> This way, it can be designed and updated with this kind of GUI tooling,
>> as a 2-way binding.
>> This can even be layered on-top of the currently existing pythonic-way of
>> writing it, using a simple parser.
>> It's just a matter of choosing a declarative format/protocol - preferably
>> something SQL-related and open standard.
>> I am unfamiliar with this field, but I am sure there are many such
>> formats that already exist.
>> This way, the schema can even be edited in whatever other external tool
>> that supports that format.
>>
>> Just as an example, a GUI graphical designer could produce something like:
>> "
>> <--! db.xml -->
>> > host="myhost">
>>   
>> 
>>   
>> 
>> "
>>
>> And then this can be used in the model as such:
>> "
>> ...
>> # prepare a 'databases' list from the xml document that was parsed
>> ...
>> for database in databases:
>>   db = DAL()
>>   ...
>>   # prepare a 'tables' list from the 'database' node's children...
>>   ...
>>   for table in tables:
>> fields = []
>> ...
>> # prepare a 'tableFields' list from the 'table' node's children...
>> ...
>> for tableField in tableFfields:
>>   ...
>>   # convert the tableFiled node into a dictionary with it'sattributes
>>   ...
>>   field = db.defineField( tableField['Name'], tableFiled[''type'] )
>>   fields.append(field)
>>
>>db.defineTable(table['name'], fields)
>> "
>>
>> This can be further integrated into the DAL class itself, of course...
>>
>
> It exists [1]
>
> Jose
>
> [1]
> https://groups.google.com/forum/?fromgroups=#!topic/web2py/DdS31FtNCjc
>
> --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Record versioning on delete CASCADE

2013-02-02 Thread Felipe Meirelles
I think they should, to be compatible with the default behaviour. Is this 
possible to do?

On Saturday, February 2, 2013 6:41:25 PM UTC-2, Massimo Di Pierro wrote:
>
> Good point. No. they are not set to is_active=False. Should they?
>
> On Saturday, 2 February 2013 06:20:47 UTC-6, Felipe Meirelles wrote:
>>
>> No, I mean, when a record is "delete" aka is_active is seted to False, 
>> the other records there make reference to it are seted false too?
>>
>> On Friday, February 1, 2013 6:19:52 PM UTC-2, Massimo Di Pierro wrote:
>>>
>>> When using versioning. Latest versions of records are never deleted, 
>>> only filtered out. I think cascade should work as expected.
>>>
>>> On Friday, 1 February 2013 11:54:25 UTC-6, Felipe Meirelles wrote:

 The cascade feature should work for record versioning enabled tables?

 Thanks.

>>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-02 Thread Jose


El sábado, 2 de febrero de 2013 13:30:49 UTC-3, Arnon Marcus escribió:
>
> It may be not directly related to this topic, but I have been thinking 
> about this for a long time now:
> Writing database schemas in python in the model is very simple and 
> decorative.
> Why not make it a declarative format?
> This way, it can be designed and updated with this kind of GUI tooling, as 
> a 2-way binding.
> This can even be layered on-top of the currently existing pythonic-way of 
> writing it, using a simple parser.
> It's just a matter of choosing a declarative format/protocol - preferably 
> something SQL-related and open standard.
> I am unfamiliar with this field, but I am sure there are many such formats 
> that already exist.
> This way, the schema can even be edited in whatever other external tool 
> that supports that format.
>
> Just as an example, a GUI graphical designer could produce something like:
> "
> <--! db.xml -->
>  host="myhost">
>   
> 
>   
> 
> "
>
> And then this can be used in the model as such:
> "
> ...
> # prepare a 'databases' list from the xml document that was parsed
> ...
> for database in databases:
>   db = DAL()
>   ...
>   # prepare a 'tables' list from the 'database' node's children...
>   ...
>   for table in tables:
> fields = []
> ...
> # prepare a 'tableFields' list from the 'table' node's children...
> ...
> for tableField in tableFfields:
>   ...
>   # convert the tableFiled node into a dictionary with it's attributes
>   ...
>   field = db.defineField( tableField['Name'], tableFiled[''type'] )
>   fields.append(field)
>
>db.defineTable(table['name'], fields)
> "
>
> This can be further integrated into the DAL class itself, of course...
>

It exists [1]

Jose

[1]  https://groups.google.com/forum/?fromgroups=#!topic/web2py/DdS31FtNCjc

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to get an excerpt from a link

2013-02-02 Thread Massimo Di Pierro
It depends. In which format is the input? markmin, html?

On Friday, 1 February 2013 22:15:13 UTC-6, sasogeek wrote:
>
> I want to do something similar to how facebook reatcs to links...
> let's say a user makes a post with a link in it (the post is not 
> necessarily just the link)
> i want to be able to grab the link from the post, make it clickable, as 
> well as a little excerpt from the contents in the page that link is 
> anchored to.
>
> eg.
>
> blabla bla blablalbal bla blalba blalba crap! this is a link 
> http://domain.com/somepage.html is a cool blog page.
>
> when a user posts the above example, i want to make 
> http://domain.com/somepage.html into an actual link which is clickable, 
> as well as show some sort of excerpt from the contents in that page... i 
> used fb as an example so it's easy to understand what i want to accomplish 
> :)
>
> help?
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Record versioning on delete CASCADE

2013-02-02 Thread Massimo Di Pierro
Good point. No. they are not set to is_active=False. Should they?

On Saturday, 2 February 2013 06:20:47 UTC-6, Felipe Meirelles wrote:
>
> No, I mean, when a record is "delete" aka is_active is seted to False, the 
> other records there make reference to it are seted false too?
>
> On Friday, February 1, 2013 6:19:52 PM UTC-2, Massimo Di Pierro wrote:
>>
>> When using versioning. Latest versions of records are never deleted, only 
>> filtered out. I think cascade should work as expected.
>>
>> On Friday, 1 February 2013 11:54:25 UTC-6, Felipe Meirelles wrote:
>>>
>>> The cascade feature should work for record versioning enabled tables?
>>>
>>> Thanks.
>>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: The Great Web Framework Shootout

2013-02-02 Thread Massimo Di Pierro
I do not recall. I do not see it there which is strange.

On Saturday, 2 February 2013 05:24:05 UTC-6, OJ wrote:
>
> Massimo, where can I find your patch? I understood that you submitted 
> web2py -patch for the shootout. I'm currently interested to see how hw 
> aspect would have effect to results and I need web2py to be part of it. 
>
> On Monday, February 20, 2012 3:51:36 PM UTC+2, Massimo Di Pierro wrote:
>>
>> I did submit a patch. I also submitted a comment on reddit. Those 
>> benchmarks are misleading. For example in Django they use the ORM but 
>> in Flask they use native sqlite, not SQLAlchemy. In Django I think 
>> they have sessions enabled, in Flask, I think no. 
>>
>> On Feb 19, 11:23 pm, Bruno Rocha  wrote: 
>> > I did not see web2py on the list... 
>> > Em 20/02/2012 03:03, "pbreit"  escreveu: 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > >http://blog.curiasolutions.com/the-great-web-framework-shootout/ 
>> > >https://github.com/seedifferently/the-great-web-framework-shootout
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Image store with open does not work on GAE

2013-02-02 Thread Massimo Di Pierro
This should work fine on GAE. Please show us your exact model. Are you 
testing with SDK?

On Saturday, 2 February 2013 04:33:56 UTC-6, Sebastian Cambeo wrote:
>
> The following line of code works perfectly well locally (no GAE):
>
> db.table1.insert(image =  open('test.jpg', 'rb')
>
> However it does not work on GAE:
> As the filesystem has no permission to write, this line of code should 
> automatically upload the blob data into "image_blob". However "image_blob" 
> remains empty.
>
> Also I should not need to save the blob data of the image by myself, as 
> the DAL should give me the data transparently (from database or file system 
> depending on whether I am on GAE or not).
>
> This is a very critical part of my application, any help would be very 
> much appreciated
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: RuntimeError: Unable to handle upload

2013-02-02 Thread Alan Etkin


> Your code also threw the same error so before I un-commented the if 
> statements in dal.py I added some print statements
>

Did you try the store command as I posted it (passing pathname and 
filename) without changing dal.py? What is the error output?

-- 

--- 
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/groups/opt_out.




[web2py] Re: Several questions - Scheduler Related

2013-02-02 Thread Morgan Hein
This answers all my questions! Thanks so much!

On Saturday, February 2, 2013 11:15:28 AM UTC-8, Niphlod wrote:
>
>
>
> On Saturday, February 2, 2013 7:06:18 PM UTC+1, Morgan Hein wrote:
>>
>> So I am using the trunk version, and finally got scheduling to run, 
>> however i'm encountering several problems (i'm assuming mostly due to my 
>> lack of understanding).
>>
>> Problem A) First off, for a while, when the workers ran the database that 
>> showed results worked. However now, workers run my script but there is no 
>> result in the scheduler_task table. I can see that the task has been run 
>> b/c the "times run" has been iterated by 1, but still no result. I tried 
>> deleting all rows, but none are being added. How can I troubleshoot this?
>>
>
> I'm assuming what you mean is that you have no scheduler_run records while 
> you expect them. If that's the case, by default if the function doesn't 
> return a result, there is no scheduler_run record available. Just return 
> something on the function (a "return 0" is fine) if you want a record on 
> "None-returning" functions
>
>
>> Problem B) What global application variables are available from tasks.py? 
>> I would like to access two objects, namely the database, as well as the 
>> folder/location of the run script (tasks.py). I could hardcode it but I 
>> feel that's bad practice. If possible i'd also love:
>>
>
> Missing the "I'd also love" part, but to answer the question anything you 
> can access from web2py, except for session (well, you can but it would be a 
> bogus session), cache.ram (it's not "shared" with web2py's process, and it 
> gets resetted for every task) and request.env (because there isn't a normal 
> request associated with a task). Everything you can use on a web2py shell 
> (web2py.py -M -S yourapp) can be used inside a task of the scheduler . 
>  
>
>>
>> Problem C) And example or short snippet of adding an entry to a db from 
>> within a task, if it's any different from within the models themselves. 
>> Thanks!
>>
>
> you can use the usual db.tablename.insert(columname=value) . The only 
> thing different in the scheduler vs the code you normally use is that you 
> must remember to do a db.commit() at the end of your function. web2py calls 
> db.commit() automatically when a request is completed, but the scheduler 
> does not.
>  
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: having a problem with the online editor

2013-02-02 Thread JFroles
Hmm thanks for the tip but no luck.  Verified JavaScript in enabled as 
well.  Tried a few other minor things like re-installing web2py but no luck 
and it's not Chrome specific because it happens in Firefox as well.


On Saturday, February 2, 2013 2:03:13 PM UTC-5, Niphlod wrote:
>
> try a ctrl+R to refresh the page refetching all the static files. That 
> visualization should happen only when javascript is disabled, which I guess 
> it's not your case
>
> On Saturday, February 2, 2013 7:17:35 PM UTC+1, JFroles wrote:
>>
>> Hey all!  I'm relatively new to web2py so I am guessing this is a simple 
>> problem.  For whatever reason web2py keeps loading what I assume to be a 
>> basic html text box instead of the actual editor (see screencap in pic) and 
>> none of the ZenCoding bindings work.  Is there an option I am not seeing 
>> that I changed by accident?
>>
>> Note: Web2py v. 2.3.2 in Chrome
>>  running on Win 7 via Cygwin
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to run web2py on Mint 9

2013-02-02 Thread Alex Glaros
  

you're right Anthony

I tried to run it from:/home/alex/web2py

but there was a copy in /home/alex/Downloads/web2py that runs correctly

thanks,

Alex
 

On Saturday, February 2, 2013 8:52:37 AM UTC-8, Alex Glaros wrote:
>
> no it's not there.  There is a large list of gluon related files, e.g.,
>
> lex@alex-desktop ~/web2py $ ls *gluon.widget*
> toc-web2py.gluon.widget-module.html  web2py.gluon.widget-module.html  
> web2py.gluon.widget.web2pyDialog-class.html
> web2py.gluon.widget.IO-class.htmlweb2py.gluon.widget-pysrc.html
>
> thanks,
>
> Alex
>
> On Saturday, February 2, 2013 8:38:43 AM UTC-8, Anthony wrote:
>>
>> Is /web2py/gluon/widget.py there?
>>
>> On Saturday, February 2, 2013 11:25:30 AM UTC-5, Alex Glaros wrote:
>>>
>>> do you mean to cd to web2py folder?  yes, I did that.  Here is the error
>>>
>>> alex@alex-desktop ~/web2py $ python2.6 web2py.py
>>> Traceback (most recent call last):
>>>   File "web2py.py", line 18, in 
>>> import gluon.widget
>>> ImportError: No module named gluon.widget
>>>
>>> thanks,
>>>
>>> Alex
>>>
>>> On Saturday, February 2, 2013 4:52:54 AM UTC-8, Anthony wrote:

 Change directory to the /web2py folder and then enter the command. 

 Anthony 

 On Saturday, February 2, 2013 2:28:37 AM UTC-5, Alex Glaros wrote: 
 > I have Mint 9 on my desktop 
 > 
 > when I type python2.5 web2py.py I get: no command 'python2.5' found 
 > 
 > when I type python web2py.py I get: importError: No module named 
 gluon.widget 
 > 
 > any suggestions?  Should I install python2.5? 
 > 
 > thanks, 
 > 
 > Alex Glaros 



-- 

--- 
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/groups/opt_out.




[web2py] Re: RuntimeError: Unable to handle upload

2013-02-02 Thread Bill Thayer
So I just replaced the first if statement with 'if True:' so that the code 
would execute. Looks like a unicode object does not have an attribute 
'file' 

(InteractiveConsole)
>>> import test_tamoto_rpc as trpc
>>> trpc.upload_file()
C:\Users\bthayer\Documents\car\carfiles.txt
wiki_media.id
wiki_media.filedata
wiki_media.cell_id
wiki_media.lib_id
wiki_media.layout_id
wiki_media.wiki_page
wiki_media.title
wiki_media.meas_id
wiki_media.filename
filename
wiki_media.filename.a8857e792725cc9c.63617266696c65732e747874.txt
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\web2py-1045bab06391\web2py-1045bab06391\applications\TAMOTO\private\test_tamoto_rpc.py",
 
line 38, in upload_file
filedata=stream.read())
  File "C:\web2py-1045bab06391\web2py-1045bab06391\gluon\dal.py", line 
8281, in insert
self._attempt_upload(fields)
  File "C:\web2py-1045bab06391\web2py-1045bab06391\gluon\dal.py", line 
8258, in _attempt_upload
new_name = field.store(value.file,filename=value.filename)
AttributeError: 'unicode' object has no attribute 'file'
>>>








-- 

--- 
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/groups/opt_out.




[web2py] Is there a way to display field or field value (instead of field name) in smartgrid breadcrumb?

2013-02-02 Thread Michael Beller
I'm using smartgrids to manage Owners and Dogs.  While navigating to the 
Dogs for an Owner from the Dogs smartgrid, the breadcrumb shows:

"
Owners>
Joe>
Dogs for f_owner" ... 

it would be much nicer to show: 

"
Owners>
Joe>Dogs for Owner" or "
Owners>
Joe>Dogs for Joe".

It would also be nice for the breadcrumb to show the singular property for 
the table, e.g., "Owner", instead of the plural property for this view.

-- 

--- 
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/groups/opt_out.




[web2py] Re: Several questions - Scheduler Related

2013-02-02 Thread Niphlod


On Saturday, February 2, 2013 7:06:18 PM UTC+1, Morgan Hein wrote:
>
> So I am using the trunk version, and finally got scheduling to run, 
> however i'm encountering several problems (i'm assuming mostly due to my 
> lack of understanding).
>
> Problem A) First off, for a while, when the workers ran the database that 
> showed results worked. However now, workers run my script but there is no 
> result in the scheduler_task table. I can see that the task has been run 
> b/c the "times run" has been iterated by 1, but still no result. I tried 
> deleting all rows, but none are being added. How can I troubleshoot this?
>

I'm assuming what you mean is that you have no scheduler_run records while 
you expect them. If that's the case, by default if the function doesn't 
return a result, there is no scheduler_run record available. Just return 
something on the function (a "return 0" is fine) if you want a record on 
"None-returning" functions


> Problem B) What global application variables are available from tasks.py? 
> I would like to access two objects, namely the database, as well as the 
> folder/location of the run script (tasks.py). I could hardcode it but I 
> feel that's bad practice. If possible i'd also love:
>

Missing the "I'd also love" part, but to answer the question anything you 
can access from web2py, except for session (well, you can but it would be a 
bogus session), cache.ram (it's not "shared" with web2py's process, and it 
gets resetted for every task) and request.env (because there isn't a normal 
request associated with a task). Everything you can use on a web2py shell 
(web2py.py -M -S yourapp) can be used inside a task of the scheduler . 
 

>
> Problem C) And example or short snippet of adding an entry to a db from 
> within a task, if it's any different from within the models themselves. 
> Thanks!
>

you can use the usual db.tablename.insert(columname=value) . The only thing 
different in the scheduler vs the code you normally use is that you must 
remember to do a db.commit() at the end of your function. web2py calls 
db.commit() automatically when a request is completed, but the scheduler 
does not.
 

-- 

--- 
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/groups/opt_out.




[web2py] Re: RuntimeError: Unable to handle upload

2013-02-02 Thread Bill Thayer
Hi Alan,

Just now getting back to this days later...

Your code also threw the same error so before I un-commented the if 
statements in dal.py I added some print statements and can see the list of 
fields, then the name of the filename field as 'filename' followed by 
wiki_media.filename.9b724ad17775d60e.63617266696c65732e747874.txt

as the value being tested for a 'file' attribute and a 'filename' attribute 
before calling the store function...(again?) This is confusing so I guess 
I'll do as you suggest and take out those lines of code.


>>> import test_tamoto_rpc as trpc
>>> trpc.upload_file()
C:\Users\bthayer\Documents\car\carfiles.txt
wiki_media.id
wiki_media.filedata
wiki_media.cell_id
wiki_media.lib_id
wiki_media.layout_id
wiki_media.wiki_page
wiki_media.title
wiki_media.meas_id
wiki_media.filename
filename
wiki_media.filename.9b724ad17775d60e.63617266696c65732e747874.txt
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\web2py-1045bab06391\web2py-1045bab06391\applications\TAMOTO\private\test_tamoto_rpc.py",
 
line 38, in upload_file
filedata=stream.read())
  File "C:\web2py-1045bab06391\web2py-1045bab06391\gluon\dal.py", line 
8280, in insert
self._attempt_upload(fields)
  File "C:\web2py-1045bab06391\web2py-1045bab06391\gluon\dal.py", line 
8262, in _attempt_upload
raise RuntimeError("Unable to handle upload")
RuntimeError: Unable to handle upload
>>>




On Tuesday, January 29, 2013 8:00:58 PM UTC-6, Alan Etkin wrote:
>
> Replacing the store call with this should avoid the error:
>
> file_id=db.wiki_media.insert(filename=db.wiki_media.filename.store(stream,filename
> =, path=file_path)
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: having a problem with the online editor

2013-02-02 Thread Niphlod
try a ctrl+R to refresh the page refetching all the static files. That 
visualization should happen only when javascript is disabled, which I guess 
it's not your case

On Saturday, February 2, 2013 7:17:35 PM UTC+1, JFroles wrote:
>
> Hey all!  I'm relatively new to web2py so I am guessing this is a simple 
> problem.  For whatever reason web2py keeps loading what I assume to be a 
> basic html text box instead of the actual editor (see screencap in pic) and 
> none of the ZenCoding bindings work.  Is there an option I am not seeing 
> that I changed by accident?
>
> Note: Web2py v. 2.3.2 in Chrome
>  running on Win 7 via Cygwin
>

-- 

--- 
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/groups/opt_out.




[web2py] Issue with the online editor

2013-02-02 Thread JFroles
Hey all!  I'm relatively new to web2py so this is most likely something 
simple I am missing but I've been having a problem with the online editor. 
 For whatever reason it keeps loading what I assume to be a basic html text 
box (seen in the pic) instead of the actual editor and none of the 
ZenCoding bindings work.  I'm guessing there is an option I am overlooking 
but I can't find it.  Anyone know why web2py would be doing this?


Note: Web2py v. 2.3.2 on Chrome
 running on Win 7 via Cygwin

-- 

--- 
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/groups/opt_out.


<>

[web2py] having a problem with the online editor

2013-02-02 Thread JFroles
Hey all!  I'm relatively new to web2py so I am guessing this is a simple 
problem.  For whatever reason web2py keeps loading what I assume to be a 
basic html text box instead of the actual editor (see screencap in pic) and 
none of the ZenCoding bindings work.  Is there an option I am not seeing 
that I changed by accident?

Note: Web2py v. 2.3.2 in Chrome
 running on Win 7 via Cygwin

-- 

--- 
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/groups/opt_out.


<>

[web2py] Several questions - Scheduler Related

2013-02-02 Thread Morgan Hein
So I am using the trunk version, and finally got scheduling to run, however 
i'm encountering several problems (i'm assuming mostly due to my lack of 
understanding).

Problem A) First off, for a while, when the workers ran the database that 
showed results worked. However now, workers run my script but there is no 
result in the scheduler_task table. I can see that the task has been run 
b/c the "times run" has been iterated by 1, but still no result. I tried 
deleting all rows, but none are being added. How can I troubleshoot this?

Problem B) What global application variables are available from tasks.py? I 
would like to access two objects, namely the database, as well as the 
folder/location of the run script (tasks.py). I could hardcode it but I 
feel that's bad practice. If possible i'd also love:

Problem C) And example or short snippet of adding an entry to a db from 
within a task, if it's any different from within the models themselves. 
Thanks!

I'm really enjoying the flow of web2py, I hope that someone can help out 
with this!

`M

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Pattern to run async proccess

2013-02-02 Thread Bruno Rocha
You can also use Redis Queue
http://rochacbruno.com.br/web2py-and-redis-queue/

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Pattern to run async proccess

2013-02-02 Thread José Luis Redrejo Rodríguez
Niphlod Thanks very much , your "learn by trial" application has been
gold for me. Catched!!

2013/2/2 Niphlod :
> you must save somewhere in your "long_time_consuming_function()" the
> progress and let the page show that.
>
> If you manage that function outside web2py (using the scheduler or not), you
> need something readable by your page and writeable by the external process.
> A record on the db, a file, something. The scheduler has a facility you can
> use for that
>
> http://web2py.com/books/default/chapter/29/04#Scheduler-%28experimental%29
>
> under the section "reporting percentages" .
>
> if you want to get familiar with the scheduler you can look at this "learn
> by trial" application
>
> https://github.com/niphlod/w2p_scheduler_tests
>
> let me know if you need further assistance on the scheduler's side.
>
> --
>
> ---
> 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/groups/opt_out.
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to run web2py on Mint 9

2013-02-02 Thread Alex Glaros
no it's not there.  There is a large list of gluon related files, e.g.,

lex@alex-desktop ~/web2py $ ls *gluon.widget*
toc-web2py.gluon.widget-module.html  web2py.gluon.widget-module.html  
web2py.gluon.widget.web2pyDialog-class.html
web2py.gluon.widget.IO-class.htmlweb2py.gluon.widget-pysrc.html

thanks,

Alex

On Saturday, February 2, 2013 8:38:43 AM UTC-8, Anthony wrote:
>
> Is /web2py/gluon/widget.py there?
>
> On Saturday, February 2, 2013 11:25:30 AM UTC-5, Alex Glaros wrote:
>>
>> do you mean to cd to web2py folder?  yes, I did that.  Here is the error
>>
>> alex@alex-desktop ~/web2py $ python2.6 web2py.py
>> Traceback (most recent call last):
>>   File "web2py.py", line 18, in 
>> import gluon.widget
>> ImportError: No module named gluon.widget
>>
>> thanks,
>>
>> Alex
>>
>> On Saturday, February 2, 2013 4:52:54 AM UTC-8, Anthony wrote:
>>>
>>> Change directory to the /web2py folder and then enter the command. 
>>>
>>> Anthony 
>>>
>>> On Saturday, February 2, 2013 2:28:37 AM UTC-5, Alex Glaros wrote: 
>>> > I have Mint 9 on my desktop 
>>> > 
>>> > when I type python2.5 web2py.py I get: no command 'python2.5' found 
>>> > 
>>> > when I type python web2py.py I get: importError: No module named 
>>> gluon.widget 
>>> > 
>>> > any suggestions?  Should I install python2.5? 
>>> > 
>>> > thanks, 
>>> > 
>>> > Alex Glaros 
>>>
>>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to run web2py on Mint 9

2013-02-02 Thread Anthony
Is /web2py/gluon/widget.py there?

On Saturday, February 2, 2013 11:25:30 AM UTC-5, Alex Glaros wrote:
>
> do you mean to cd to web2py folder?  yes, I did that.  Here is the error
>
> alex@alex-desktop ~/web2py $ python2.6 web2py.py
> Traceback (most recent call last):
>   File "web2py.py", line 18, in 
> import gluon.widget
> ImportError: No module named gluon.widget
>
> thanks,
>
> Alex
>
> On Saturday, February 2, 2013 4:52:54 AM UTC-8, Anthony wrote:
>>
>> Change directory to the /web2py folder and then enter the command. 
>>
>> Anthony 
>>
>> On Saturday, February 2, 2013 2:28:37 AM UTC-5, Alex Glaros wrote: 
>> > I have Mint 9 on my desktop 
>> > 
>> > when I type python2.5 web2py.py I get: no command 'python2.5' found 
>> > 
>> > when I type python web2py.py I get: importError: No module named 
>> gluon.widget 
>> > 
>> > any suggestions?  Should I install python2.5? 
>> > 
>> > thanks, 
>> > 
>> > Alex Glaros 
>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-02 Thread Paolo Caruccio
thank you.

package downloaded from [1]
setup.py modified following istructions on [2]

After setup.py install command all worked fine.


Il giorno sabato 2 febbraio 2013 14:03:09 UTC+1, Jose ha scritto:
>
>
>
> El viernes, 1 de febrero de 2013 15:50:43 UTC-3, Paolo Caruccio escribió:
>>
>> Jose. thank you too for the amazing idea to draw a graph of the database.
>>
>> I take the opportunity to ask you where I can download a working 
>> pygraphviz build for windows.
>>
>>
> Tried with this [1] or [2]?
>
>
> [1] http://pypi.python.org/pypi/pygraphviz/1.1
> [2] 
> https://groups.google.com/forum/?fromgroups=#!topic/networkx-discuss/Xy1lWfMdB6U
>  
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-02 Thread Arnon Marcus
It may be not directly related to this topic, but I have been thinking 
about this for a long time now:
Writing database schemas in python in the model is very simple and 
decorative.
Why not make it a declarative format?
This way, it can be designed and updated with this kind of GUI tooling, as 
a 2-way binding.
This can even be layered on-top of the currently existing pythonic-way of 
writing it, using a simple parser.
It's just a matter of choosing a declarative format/protocol - preferably 
something SQL-related and open standard.
I am unfamiliar with this field, but I am sure there are many such formats 
that already exist.
This way, the schema can even be edited in whatever other external tool 
that supports that format.

Just as an example, a GUI graphical designer could produce something like:
"
<--! db.xml -->

  

  

"

And then this can be used in the model as such:
"
...
# prepare a 'databases' list from the xml document that was parsed
...
for database in databases:
  db = DAL()
  ...
  # prepare a 'tables' list from the 'database' node's children...
  ...
  for table in tables:
fields = []
...
# prepare a 'tableFields' list from the 'table' node's children...
...
for tableField in tableFfields:
  ...
  # convert the tableFiled node into a dictionary with it's attributes
  ...
  field = db.defineField( tableField['Name'], tableFiled[''type'] )
  fields.append(field)

   db.defineTable(table['name'], fields)
"

This can be further integrated into the DAL class itself, of course...

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to run web2py on Mint 9

2013-02-02 Thread Alex Glaros
do you mean to cd to web2py folder?  yes, I did that.  Here is the error

alex@alex-desktop ~/web2py $ python2.6 web2py.py
Traceback (most recent call last):
  File "web2py.py", line 18, in 
import gluon.widget
ImportError: No module named gluon.widget

thanks,

Alex

On Saturday, February 2, 2013 4:52:54 AM UTC-8, Anthony wrote:
>
> Change directory to the /web2py folder and then enter the command. 
>
> Anthony 
>
> On Saturday, February 2, 2013 2:28:37 AM UTC-5, Alex Glaros wrote: 
> > I have Mint 9 on my desktop 
> > 
> > when I type python2.5 web2py.py I get: no command 'python2.5' found 
> > 
> > when I type python web2py.py I get: importError: No module named 
> gluon.widget 
> > 
> > any suggestions?  Should I install python2.5? 
> > 
> > thanks, 
> > 
> > Alex Glaros 
>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: create query for join multiple table

2013-02-02 Thread Niphlod


On Saturday, February 2, 2013 2:07:15 AM UTC+1, 黄祥 wrote:
>
> thank you so much for your hints niphlod.
> yes you re right that i want is "all data of the company the current user 
> belongs to"
> actually i've just modified your hints and works well
>
> def invoice():
> query=db(db.sale.invoice_no==request.args(0)).select().first()
> row=db((db.company.id==db.auth_user.company_id)&
>(query.created_by==db.auth_user.id)).select().first()
> invoices=db(db.sale.invoice_no==request.args(0)).select()
> return dict(query=query, row=row, invoices=invoices)
>
> how do you think?
>

I really think that your requirements don't match those queries...
you fetch a single db.sale line right in the first statement. 
Then, "row" takes presumably the company from the user who created the 
invoice 
Then another identical query for assigning "invoices" to more or less the 
same thing of "query"
Wasn't the purpose of the thread to fetch all the data (company, invoices, 
etc) of the current user ?

 

> i'm just still confuse the relation between
> company_id = db(db.auth_user.id == 
> auth.user_id).select().first().company_id
>

company_id is the "integer" referencing your company inside the auth_user 
table. All users belonging to a company have the same integer in the 
company_id column.
The previous query broken to pieces is
db(db.auth_user.id == auth.user_id) ##auth.user_id is the id of the 
currently logged-in user, or none if the user isn't logged.
.select().first() ## retrieve the record of the user from the auth_user 
table
.company_id ##retrieve the value stored into the company_id column

 

> and
> db.auth_user.company_id == company_id
>
> This fetches all the users belonging to the same company (i.e. given a 
company_id = 3, all the rows in the auth_user table that have the 
company_id column == 3) 

-- 

--- 
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/groups/opt_out.




[web2py] Re: Adding a scheduled task using the scheduler results in db error.

2013-02-02 Thread Niphlod
if your db is istantiated with check_reserved=['all'] then you need to 
fetch the gluon/scheduler.py from trunk and use that, because in 2.3.2 
stable the column names of the scheduler's table are not compatible. 

On Saturday, February 2, 2013 5:44:01 AM UTC+1, Morgan Hein wrote:
>
> Massimo,
>
> Wow that's customer support. Thanks for the quick reply!
>
> However I am using 2.3.2, which is what is listed as the stable version. 
> Do I need to download the experimental to get the scheduler to work?
>
> Also, is it possible for me to just delete the old tables, replace web2py, 
> and it will auto-create the new tables again?
>
> Thanks!
>
> `M
>
> On Friday, February 1, 2013 8:14:19 PM UTC-8, Massimo Di Pierro wrote:
>>
>> You have an older version of the scheduler (and web2py). Your scheduler 
>> tables have a field called "output" This field was renamed "run_output".
>> This is because some database engines consider "output" a reserved 
>> keyword.
>>
>> Massimo
>>
>> On Friday, 1 February 2013 22:10:48 UTC-6, Morgan Hein wrote:
>>>
>>> Howdy!
>>>
>>> I have been following the video tutorial to create a schedule task. 
>>>
>>> Inside the bottom of the task to be run I have:
>>>
>>> def main():
>>> o = MarketReader()
>>> o.run()
>>> 
>>> from gluon.scheduler import Scheduler
>>> Scheduler(db,dict(update_market=main))
>>>
>>>
>>> When I browse back to the database management, I receive the following 
>>> error:
>>>
>>> TICKET ID
>>>
>>> 127.0.0.1.2013-02-01.19-58-07.6e66c0a0-a0fa-49e0-b6b6-70ddb741fbeb
>>>  invalid table/column name "output" is a 
>>> "ALL" reserved SQL keywordVERSIONweb2py™(2, 3, 2, datetime.datetime(2012
>>> , 12, 17, 15, 3, 30), 'stable')PythonPython 2.7.3: /usr/bin/python
>>>
>>> Traceback (most recent call last):
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/restricted.py", line 212, 
>>> in restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/johnnyfive/Downloads/web2py/applications/EveMarket/models/tasks.py" 
>>> , line 
>>> 101, in 
>>> Scheduler(db,dict(update_market=main))
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/scheduler.py", line 449, in 
>>> __init__
>>> self.define_tables(db, migrate=migrate)
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/scheduler.py", line 513, in 
>>> define_tables
>>> migrate=migrate)
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 7186, in 
>>> define_table
>>> table = self.lazy_define_table(tablename,*fields,**args)
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 7203, in 
>>> lazy_define_table
>>> table = table_class(self, tablename, *fields, **args)
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 7609, in 
>>> __init__
>>> db.check_reserved_keyword(field_name)
>>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 6930, in 
>>> check_reserved_keyword
>>> 'invalid table/column name "%s" is a "%s" reserved SQL keyword' % 
>>> (name, backend.upper()))
>>> SyntaxError: invalid table/column name "output" is a "ALL" reserved SQL 
>>> keyword
>>>
>>>
>>> Variablesbackend'all'name'output'backend.upper>> str object>
>>>
>>> Any ideas? I'm feeling like the task scheduler is trying to create a 
>>> database column with the name of "output"?
>>>
>>> Thanks!
>>>
>>>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Pattern to run async proccess

2013-02-02 Thread Niphlod
you must save somewhere in your "long_time_consuming_function()" the 
progress and let the page show that. 

If you manage that function outside web2py (using the scheduler or not), 
you need something readable by your page and writeable by the external 
process. A record on the db, a file, something. The scheduler has a 
facility you can use for that 

http://web2py.com/books/default/chapter/29/04#Scheduler-%28experimental%29

under the section "reporting percentages" . 

if you want to get familiar with the scheduler you can look at this "learn 
by trial" application

https://github.com/niphlod/w2p_scheduler_tests

let me know if you need further assistance on the scheduler's side.

-- 

--- 
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/groups/opt_out.




[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-02 Thread Jose


El viernes, 1 de febrero de 2013 15:50:43 UTC-3, Paolo Caruccio escribió:
>
> Jose. thank you too for the amazing idea to draw a graph of the database.
>
> I take the opportunity to ask you where I can download a working 
> pygraphviz build for windows.
>
>
Tried with this [1] or [2]?


[1] http://pypi.python.org/pypi/pygraphviz/1.1
[2] 
https://groups.google.com/forum/?fromgroups=#!topic/networkx-discuss/Xy1lWfMdB6U
 


-- 

--- 
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/groups/opt_out.




[web2py] Re: The Great Web Framework Shootout

2013-02-02 Thread OJ
Massimo, where can I find your patch? I understood that you submitted 
web2py -patch for the shootout. I'm currently interested to see how hw 
aspect would have effect to results and I need web2py to be part of it. 

On Monday, February 20, 2012 3:51:36 PM UTC+2, Massimo Di Pierro wrote:
>
> I did submit a patch. I also submitted a comment on reddit. Those 
> benchmarks are misleading. For example in Django they use the ORM but 
> in Flask they use native sqlite, not SQLAlchemy. In Django I think 
> they have sessions enabled, in Flask, I think no. 
>
> On Feb 19, 11:23 pm, Bruno Rocha  wrote: 
> > I did not see web2py on the list... 
> > Em 20/02/2012 03:03, "pbreit"  escreveu: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > >http://blog.curiasolutions.com/the-great-web-framework-shootout/ 
> > >https://github.com/seedifferently/the-great-web-framework-shootout

-- 

--- 
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/groups/opt_out.




[web2py] Re: how to run web2py on Mint 9

2013-02-02 Thread Anthony
Change directory to the /web2py folder and then enter the command.

Anthony

On Saturday, February 2, 2013 2:28:37 AM UTC-5, Alex Glaros wrote:
> I have Mint 9 on my desktop
> 
> when I type python2.5 web2py.py I get: no command 'python2.5' found
> 
> when I type python web2py.py I get: importError: No module named gluon.widget
> 
> any suggestions?  Should I install python2.5?
> 
> thanks,
> 
> Alex Glaros

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Pattern to run async proccess

2013-02-02 Thread José Luis Redrejo Rodríguez
I've been studying the scheduler, but I think it fails in one of the
things I need:
"The web page must be updated as the process is being done"
i.e. if the scheduler is doiing some background task, I need to update
the web page with the progress of the task, but I don't find how to do
it with the scheduler

2013/2/1 Massimo Di Pierro :
> yes. If the worker is not busy it starts the task immediately. You can also
> have more than one worker.
>
>
> On Friday, 1 February 2013 11:10:11 UTC-6, José Luis Redrejo Rodríguez
> wrote:
>>
>> Thanks for your advice Massimo, but
>> does the scheduler start inmediately when no worker has been used before?
>>
>>
>> 2013/2/1 Massimo Di Pierro :
>> > All that you ask can be done using the scheduler except that your app
>> > does
>> > not start the process, but submits a request to the scheduler. The
>> > scheduler
>> > runs the app when a worker is available. This is to prevent spikes in
>> > resource utilization when multiple processes start. The task can
>> > communicate
>> > with the app vid database and/or filesystem (which is ok but not 100%
>> > satisfactory). Web2py can monitor and kill running scheduler tasks.
>> >
>> > This works well for most types of tasks but not for tasks that need a
>> > lot of
>> > IO with your application. I do not have a satisfactory solution in that
>> > case. You want the tasks to have some way to communicate asynchronously
>> > with
>> > the client and this present major issues, some related with security.
>> >
>> >
>> > On Friday, 1 February 2013 10:22:35 UTC-6, José Luis Redrejo Rodríguez
>> > wrote:
>> >>
>> >> Hi, This is a question that has been asked several times in the list,
>> >> and I have also had to implement this kind of app in the past.
>> >> Now I'm also facing to another application where I need to run a
>> >> resource_and_time_consuming process managed from web2py.
>> >>
>> >> The exact problem is:
>> >> - From a web page, a long process must be started
>> >> - The web page must be updated as the process is being done
>> >> - The web page must be able to cancel the process.
>> >>
>> >> In the past I have had to deal with the fact of sessions lockings:
>> >> web2py server doesn't react while the process is being executed. I've
>> >> solved this by using session.forget(response), but this solution
>> >> avoids the use of session variables to update the process in the
>> >> original web page.
>> >>
>> >> I've used background processes, queues, etc, These solutions work when
>> >> time is not an issue, but not when the synchronization between the
>> >> process and the webpage must be fast and accurate
>> >>
>> >> I wonder if someone has a definitive pattern to do this kind of action.
>> >>
>> >> Regards
>> >> José L.
>> >
>> > --
>> >
>> > ---
>> > 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/groups/opt_out.
>> >
>> >
>
> --
>
> ---
> 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/groups/opt_out.
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Record versioning on delete CASCADE

2013-02-02 Thread Felipe Meirelles
No, I mean, when a record is "delete" aka is_active is seted to False, the 
other records there make reference to it are seted false too?

On Friday, February 1, 2013 6:19:52 PM UTC-2, Massimo Di Pierro wrote:
>
> When using versioning. Latest versions of records are never deleted, only 
> filtered out. I think cascade should work as expected.
>
> On Friday, 1 February 2013 11:54:25 UTC-6, Felipe Meirelles wrote:
>>
>> The cascade feature should work for record versioning enabled tables?
>>
>> Thanks.
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Adding a scheduled task using the scheduler results in db error.

2013-02-02 Thread Morgan Hein
Massimo,

Wow that's customer support. Thanks for the quick reply!

However I am using 2.3.2, which is what is listed as the stable version. Do 
I need to download the experimental to get the scheduler to work?

Also, is it possible for me to just delete the old tables, replace web2py, 
and it will auto-create the new tables again?

Thanks!

`M

On Friday, February 1, 2013 8:14:19 PM UTC-8, Massimo Di Pierro wrote:
>
> You have an older version of the scheduler (and web2py). Your scheduler 
> tables have a field called "output" This field was renamed "run_output".
> This is because some database engines consider "output" a reserved keyword.
>
> Massimo
>
> On Friday, 1 February 2013 22:10:48 UTC-6, Morgan Hein wrote:
>>
>> Howdy!
>>
>> I have been following the video tutorial to create a schedule task. 
>>
>> Inside the bottom of the task to be run I have:
>>
>> def main():
>> o = MarketReader()
>> o.run()
>> 
>> from gluon.scheduler import Scheduler
>> Scheduler(db,dict(update_market=main))
>>
>>
>> When I browse back to the database management, I receive the following 
>> error:
>>
>> TICKET ID
>>
>> 127.0.0.1.2013-02-01.19-58-07.6e66c0a0-a0fa-49e0-b6b6-70ddb741fbeb
>>  invalid table/column name "output" is a 
>> "ALL" reserved SQL keywordVERSIONweb2py™(2, 3, 2, datetime.datetime(2012, 
>> 12, 17, 15, 3, 30), 'stable')PythonPython 2.7.3: /usr/bin/python
>>
>> Traceback (most recent call last):
>>   File "/home/johnnyfive/Downloads/web2py/gluon/restricted.py", line 212, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/home/johnnyfive/Downloads/web2py/applications/EveMarket/models/tasks.py" 
>> , line 
>> 101, in 
>> Scheduler(db,dict(update_market=main))
>>   File "/home/johnnyfive/Downloads/web2py/gluon/scheduler.py", line 449, in 
>> __init__
>> self.define_tables(db, migrate=migrate)
>>   File "/home/johnnyfive/Downloads/web2py/gluon/scheduler.py", line 513, in 
>> define_tables
>> migrate=migrate)
>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 7186, in 
>> define_table
>> table = self.lazy_define_table(tablename,*fields,**args)
>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 7203, in 
>> lazy_define_table
>> table = table_class(self, tablename, *fields, **args)
>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 7609, in 
>> __init__
>> db.check_reserved_keyword(field_name)
>>   File "/home/johnnyfive/Downloads/web2py/gluon/dal.py", line 6930, in 
>> check_reserved_keyword
>> 'invalid table/column name "%s" is a "%s" reserved SQL keyword' % (name, 
>> backend.upper()))
>> SyntaxError: invalid table/column name "output" is a "ALL" reserved SQL 
>> keyword
>>
>>
>> Variablesbackend'all'name'output'backend.upper> str object>
>>
>> Any ideas? I'm feeling like the task scheduler is trying to create a 
>> database column with the name of "output"?
>>
>> Thanks!
>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] LinkedIn?

2013-02-02 Thread Marin Pranjić
Hello,

I am using this  as a linkedin 
api but I don't like it. I guess the API has changed and it's not 
maintained anymore. Is there a better one?

Marin

-- 

--- 
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/groups/opt_out.




[web2py] Image store with open does not work on GAE

2013-02-02 Thread Sebastian Cambeo
The following line of code works perfectly well locally (no GAE):

db.table1.insert(image =  open('test.jpg', 'rb')

However it does not work on GAE:
As the filesystem has no permission to write, this line of code should 
automatically upload the blob data into "image_blob". However "image_blob" 
remains empty.

Also I should not need to save the blob data of the image by myself, as the 
DAL should give me the data transparently (from database or file system 
depending on whether I am on GAE or not).

This is a very critical part of my application, any help would be very much 
appreciated

-- 

--- 
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/groups/opt_out.