Re: [web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Philip Kilner
Hi Arnon, On 03/05/2013 23:16, Arnon Marcus wrote: Granted, you could use the ID in a DAL context, in a similar way that you would use an ORM-class-instance within the ORM context, but there are other things that an ORM-object can do within an ORM context (aside from these examples), that an ID

Re: [web2py] Re: web2py doesn't start!

2013-05-04 Thread Nader Emami
Thank you for your advice. I would explain what I have done to set-off the IPV6 option. Firstly I have uncomment the statement "alias net-pf-10 off # IPv6" in the file "/etc/modprobe.d/aliases.conf" and then run "python web2py.py". Unfortunately without any result, I got the same erro

Re: [web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
Yes, I have actually suggested this myself. SQLA is layered, so it has it's ORM layer built on-top. It very well may be a viable option. However, it is not entierly clear how complex it could be, since the SQLA core is heavilly integrated into the ORM layer. Now, since it is all ope-source code

[web2py] Re: mobile menu links won't work. "%3Ca%20href="

2013-05-04 Thread BlueShadow
Hi, I got no clue what you mean by open a ticket. There is no error ticket generated for this. Am Samstag, 4. Mai 2013 00:04:15 UTC+2 schrieb Massimo Di Pierro: > > Please open a ticket about this. > > On Friday, 3 May 2013 15:43:29 UTC-5, BlueShadow wrote: >> >> Hi, >> I just discovered the my

Re: [web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
Also, come to think of it, it seems extremely bizarre to me, that this community is not receptive to the ORM concept, and here is why: Web2py is already doing some radically-unorthodox things, architecturally, sometimes paying heavy-prices for it, all in order to gain more conciseness of code -

Re: [web2py] Re: web2py doesn't start!

2013-05-04 Thread Nader Emami
On 4 May 2013 11:09, "Nader Emami" wrote: > Thank you for your advice. I would explain what I have done to set-off the > IPV6 option. > > Firstly I have uncomment the statement "alias net-pf-10 off # > IPv6" in the file "/etc/modprobe.d/aliases.conf" and then run "python > web2py.py"

[web2py] Re: scraping utils in controller

2013-05-04 Thread Leonel Câmara
I think you should put the scraping code in a module. It's a simple separation of concerns thing to me. Think about it, you may like this data scrapped and parsed in other projects. Then in the controller/scheduler function you could import the module ask it to give you the new rows of the t

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
> > > Technically, it would be db.Country(Name=countryName).City(db.City.Name== > cityName).select().first() > . > > 10x for correcting me. > The way you have coded it, it is actually 6 round trips -- there are 2 > selects per function -- one for the country, and a second for the city. But >

[web2py] Re: mobile menu links won't work. "%3Ca%20href="

2013-05-04 Thread Loïc
You can open a ticket here https://code.google.com/p/web2py/issues/list Le samedi 4 mai 2013 12:47:56 UTC+2, BlueShadow a écrit : > > Hi, > I got no clue what you mean by open a ticket. > There is no error ticket generated for this. > > > Am Samstag, 4. Mai 2013 00:04:15 UTC+2 schrieb Massimo D

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Anthony
It is also worth noting that when using SQLA in a web application, each SQLA session lasts for only a single web request. So, any benefits you may get from having the ORM maintain its own transaction-like session with identity-mapping, etc. are limited to the timescale of a single request. This

[web2py] Multi-language field content

2013-05-04 Thread Reza Shah
Hi, I'm planning a feature which allowed the user to display the content of country name in english or japanese and for item_data name in english, in japanese(kanji) or in japanese pronunciation(kana). The target user mostly foreigners which have basic japanese ability, they just use visual abi

Re: [web2py] Re: web2py doesn't start!

2013-05-04 Thread Jonathan Lundell
On 4 May 2013, at 2:09 AM, Nader Emami wrote: > Thank you for your advice. I would explain what I have done to set-off the > IPV6 option. > > Firstly I have uncomment the statement "alias net-pf-10 off # > IPv6" in the file "/etc/modprobe.d/aliases.conf" and then run "python > we

[web2py] Scheduler - calling functions outside a model?

2013-05-04 Thread Simon Ashley
Have a query on the scheduler and whether functions need to be defined inside a model or can be offload to a controller? (have seen a passing comment by Niphlod - which I can no longer find - that it may not be the case with ComfortScheduler but haven't been able to confirm it or worked out how

[web2py] Re: Multi-language field content

2013-05-04 Thread 黄祥
imho, i think your define table is redundant if you do like your post above e.g. field name1 is redundant with name2. i think it can be achieve you only create 1 table field called name and translate it using T(). define the japanese language translation on the languages folder and create new fi

[web2py] Re: Scheduler - calling functions outside a model?

2013-05-04 Thread Niphlod
I'm not sure I understood your requirements... how can a "controller" function can be scheduled as a task? On the last comma you talk about extensive routines: aren't they in a module ? On Saturday, May 4, 2013 4:12:21 PM UTC+2, Simon Ashley wrote: > > Have a query on the scheduler and whether f

Re: [web2py] Re: web2py doesn't start!

2013-05-04 Thread Nader Emami
which "trunk"? I don't see any one! On 4 May 2013 16:10, Jonathan Lundell wrote: > On 4 May 2013, at 2:09 AM, Nader Emami wrote: > > Thank you for your advice. I would explain what I have done to set-off the > IPV6 option. > > Firstly I have uncomment the statement "alias net-pf-10 off

Re: [web2py] Re: web2py doesn't start!

2013-05-04 Thread 黄祥
please go to http://web2py.com/init/default/download and then click source code in for testers coloumn On Saturday, May 4, 2013 10:43:26 AM UTC-4, Nader Emami wrote: > > which "trunk"? I don't see any one! > > > On 4 May 2013 16:10, Jonathan Lundell >wrote: > >> On 4 May 2013, at 2:09 AM, Nader E

[web2py] Re: scraping utils in controller

2013-05-04 Thread villas
> Actually, at the moment, the above will generate an error because apparently there is an unbalanced tag somewhere on the web2py.com page. Yes scraping real-life websites is frustrating because so much html is broken. In the end I achieved reasonable success with Beautifulsoup. However, I

[web2py] Web2py ->Eclipse->Pyodbc

2013-05-04 Thread v1s
Hello All, I have been using web2py for a few days now and its really good. I wish to now set up an the environment in eclipse and run web2py from there. Currently i am using eclipse with pydev plugin and pyodbc for databse access to sql server. Is there a good tutorial which explains me on how

[web2py] Re: Web2py ->Eclipse->Pyodbc

2013-05-04 Thread Massimo Di Pierro
I just came across this: https://code.google.com/p/neo-web2py2eclipse/ I did not try it. Does it help? On Saturday, 4 May 2013 10:44:33 UTC-5, v1s wrote: > > Hello All, > > I have been using web2py for a few days now and its really good. I wish to > now set up an the environment in eclipse and ru

[web2py] Re: Unable to store incremented values in data store as a next record

2013-05-04 Thread Massimo Di Pierro
What's the model? The "incrementation" must be done at the web2py level not the db level since not all DBs support time shifting. On Friday, 3 May 2013 00:24:58 UTC-5, Mukesh Gaur wrote: > > Hi, > > I am facing below challenges/ issue: > > 1. Unable to store incremented start date and relat

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
On Saturday, May 4, 2013 6:07:21 AM UTC-7, Anthony wrote: > > It is also worth noting that when using SQLA in a web application, each > SQLA session lasts for only a single web request. So, any benefits you may > get from having the ORM maintain its own transaction-like session with > identity

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Anthony
> def a_child_was_born_in(countryName, cityName): >> query = (db.City.Name == cityName) & (db.City.Country.belongs(db. >> Country.Name == countryName)) >> db(query).update(Population=db.City.Population + 1) >> >> > Obviously I could have done it this way, but I wanted an example that I >

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Massimo Di Pierro
In web2py we assume the code within one transaction is executed sequentially. When you say "being used by different contexts within the same transaction" you seem two assume different threads may act on data within the same transaction. I think going that rout is dangerous and should not be enc

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Anthony
> However, this is also true in SQLA -- if you make a separate query that >> happens to retrieve a record you have previously updated in the session, >> the previous update will first be flushed to the database before the later >> query -- so you still end up with the same number of updates as

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
No, I am not assuming that. Different contexes can, and actually often do, exisr within a serially run single-thrrad. The difference in contexts lie in the different namespaces being generated by the mere action of calling a function. I am not edorcing multythreading by any means, but even if I w

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
No, I am not assuming that. Different contexes can, and actually often do, exisr within a serially run single-thrrad. The difference in contexts lie in the different namespaces being generated by the mere action of calling a function. I am not edorcing multythreading by any means, but even if I w

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
No, I am not assuming that. Different contexes can, and actually often do, exisr within a serially run single-thrrad. The difference in contexts lie in the different namespaces being generated by the mere action of calling a function. I am not edorcing multythreading by any means, but even if I w

[web2py] data into row

2013-05-04 Thread lucas
hello one and all, i need the most efficient way to convert raw data into a row of a specific format. what is the most efficient way to do this in python. yes, probably more a python question then web2py. anyway, a bit more details, right now i pass a row from a table to a function and the f

[web2py] Re: Scheduler - calling functions outside a model?

2013-05-04 Thread Simon Ashley
Thanks Niphlod .. 1. yes - a 'controller function" scheduled as a task. 2. routines are in controllers, rather than modules. (some calculations/ transforms may change regularly) On Sunday, 5 May 2013 00:25:30 UTC+10, Niphlod wrote: > > I'm not sure I understood your requirements... how can a "co

[web2py] Re: web2py resources

2013-05-04 Thread Fabiano
This thread has a very useful collection references and resources. I've seen a lot of great stuff on this list but over time it gets harder to dig the mailing due the high amount of messages. I understand somethings don't fit on the main website and putting things in there requires some effort

[web2py] Re: web2py resources

2013-05-04 Thread Anthony
You can post recipes and articles here: http://www.web2pyslices.com/slice/show/1583/web2py-environment-globals-and-locals-objects. There was at least one wiki in the past, but it became neglected and ultimately abandoned. Anthony On Saturday, May 4, 2013 6:38:01 PM UTC-4, Fabiano wrote: > > T

[web2py] Re: ORM (?) : A Revisit, NOT a Rebuttal

2013-05-04 Thread Arnon Marcus
> Now, you might argue that this is just a bad example, and that there is > some real-world example where the web2py DAL will be forced to do something > like you have coded here, and that's where the ORM will have an advantage. > If that's the case, then you should have no problem presenting

[web2py] Developers/contributors guidelines?

2013-05-04 Thread Fabiano Engler
Hi all, I have looked for some information on how web2py is developed and maintained, I found some bits of info here and there but no single document on the topic, hence I am proposing for one to be created, making web2py more open to contributors, especially making it easier for casual ones. Som

Re: [web2py] Re: You can chain @make_member_of decorator

2013-05-04 Thread Vinicius Assef
Nice. :-) On Sat, May 4, 2013 at 12:16 AM, Massimo Di Pierro wrote: > This is in trunk but instead of > > db.define_table('person', > Field('name'), > Field('gender'), > Field('birthdate', 'date')) > > db.define_table('animal', > Field('name'), > Field('gender'), > Field('

Re: [web2py] Developers/contributors guidelines?

2013-05-04 Thread Vinicius Assef
I like the idea. On Sat, May 4, 2013 at 8:16 PM, Fabiano Engler wrote: > Hi all, > > I have looked for some information on how web2py is developed and > maintained, I found some bits of info here and there but no single > document on the topic, hence I am proposing for one to be created, > making

[web2py] How to have an app-wise global var?

2013-05-04 Thread Fabiano Engler
How can I have app-wise global var in web2py? As the models, controllers and views of web2py are executed for every request, I cannot set a var on the top level scope of these files as that assignment will be re-executed every request and reset the value. Testing if the variable is already set in

[web2py] Re: Conditional Fields in Custom Forms

2013-05-04 Thread Fabiano
The problem seems to be your selector on jQuery. When using SQLForm it generates a table for you and you are hiding/showing a table row, jQuery('#no_table_band__row'). On your custom form, you don't have that row, hence it won't work, but you should have that field and the selector would be jQu

[web2py] copy a DAL row

2013-05-04 Thread lucas
hello one and all, how do you copy a DAL row to a variable ensuring that the copy has a difference instance and memory address. this way when the contents change in the copy, the original is left separate and unchanged. good? lucas -- --- You received this message because you are subscrib

Re: [web2py] copy a DAL row

2013-05-04 Thread Vinicius Assef
You can save your row as a dict(): >>> row = db.mytable(id) >>> saved_row = row.as_dict() On Sat, May 4, 2013 at 11:54 PM, lucas wrote: > hello one and all, > > how do you copy a DAL row to a variable ensuring that the copy has a > difference instance and memory address. this way when the con

Re: [web2py] How to have an app-wise global var?

2013-05-04 Thread Vinicius Assef
Set your variable to session: >>> session.my_var = "my_content" http://web2py.com/books/default/chapter/29/03#Let's-count ;-) On Sat, May 4, 2013 at 11:11 PM, Fabiano Engler wrote: > How can I have app-wise global var in web2py? > > As the models, controllers and views of web2py are executed f

Re: [web2py] How to have an app-wise global var?

2013-05-04 Thread Fabiano
I can't use sessions because then the variables would be stored per session, not per app. I need all requests (hence all sessions) to share the same instance. Also it seems web2py stores sessions on disk, which is against my requirements. Fabiano. -- --- You received this message because yo