[web2py] Re: How to get and use attributes from Active Directory

2015-09-16 Thread Leonel Câmara
I don't have experience with AD but If people are logging in with LDAP you 
can access their attributes the same way you do for other users. See the 
comment in web2py/gluon/contrib/login_methods/ldap_auth.py

-- 
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 - Front-end performance optimization tutorial

2015-09-16 Thread Louis Amon

>
> Let's start saying that these optimizations are on the far End of your - 
> high end - project, right were you want to optimize till the last bit to 
> get < 200ms load times. This helps everyone to focus on the fact that these 
> operations need to be considered at that stage and that stage only: doing 
> lots of work to cut from 500ms to 450ms is not going to make your app 
> "speedy" at all, use your time to tune everything BUT static files.


Well the title does say "optimization". Nothing here is mandatory.

I do think that these are more than "guidelines for high-end projects" 
though : it's a matter of best-practices, which will help any project 
achieve top-grade responsivity without requiring a lot of research...

SEO-wise, your website's ranking on Google PageSpeed does affect your 
visibility on the search engine so I really don't think performance is 
wasted on any public website.
 

> - static assets from 3rd party: you can minify your own bundle and upload 
> it to a CDN or use publicly available CDNs. Publicly available CDNs are FAR 
> MORE reliable than your own, with one pro being the fact that the user 
> would probably not need to download the resource (its probably in the 
> browser's cache already). The con here is that your bundle (think, e.g., 
> jquery.js + moment.js) isn't available as a single file in publicly 
> available CDNs.
>

Interesting point : using public CDNs for open-source resources vs bundling 
them with your own code ?

I will have to disagree on public CDNs being more reliable that private 
ones. It's just mathematically wrong.
Public CDNs like cdnjs for instance will give an unstable bandwidth, 
depending on the load they get, which you can't measure beforehand.
Owning your own high-end CDN guarantees you will have a constant bandwidth.

In terms of load speed, it's usually better to have one optimised bundle 
than having to load multiple resources.
In terms of project management, it's also easier to manage one bundle than 
handling vendors & private code separately.

If you don't want to take my word for it, just have a look at big websites 
around : they all resort to bundling.
 

> - dynamic assets: again, minification and bundling to a CDN are not really 
> web2py's job but at most for a script. Use whatever you'd like
>

Minification & bundling are now, but versioning & caching should be. 
 

> - dynamic images: if you're going to serve them a lot, don't compress 
> on-the-fly. Compress either at first-access, then serve at nth access, or 
> compress with an async task.
>

The easy answer here is to compress & save into a file (for instance on 
Amazon S3). That would work just fine for most projects.

I'm working on an alternative solution these days : argument-based, on the 
fly image pre-processing with a cache proxy.

For instance, a request to 
"http://website.com/download/picture.png?width=200=300; could be 
processed on the fly and served behind a CDN for caching. The CDN would 
ensure that you process this image for this size only once, negating the 
CPU overhead. This kind of structure is more flexible than fixed-size files.
 

> - html minification: I'd really like to see a gzipped response (which is 
> the 90% gain) confronted to a minified-gzipped response (which would be the 
> 10% gain). I don't see it in the wild and frankly I wouldn't spend cpu on 
> it. Just gzip it
>

Most of the gain does come from compression. Minfiication... will depend on 
how you structure your code I guess.

In my case, minification helped achieve roughly 1KB after compression so 
nothing fancy. I have no figures about the CPU overhead though but I'd be 
interested if anyone has them.
 

> - cache headers: use @cache.action: it's specifically coded for it
>

Yes & no.
In Python, we tend to think explicit > implicit.

@cache.action is a sweet helper, but it does everything implicitly so you 
don't really understand or control what you're doing.

Practically speaking, I had to stray from it because it's lacking the 
"Access-Control-Allow-Origin" header, which is mandatory for CORS 
management.
It also doesn't set the "Last-Modified" header which is important if you 
want to leverage browser-side caching (304 responses).
 

> - web2py's versioning system: it's hardly "even close to blablabla". 
> web2py's versioning system is specifically engineered to work with CDNs and 
> upstream proxyies. 
>
> On the last point, I really have to see a simpler develop-to-prod 
> deployment.
> Probably it's you not grasping it, the docs feel quite clear you 
> develop whatever you need, you create your main.js and main.css with 
> whatever build system you'd like, leave the files in the static folder 
> (e.g. /static/css/main.css, /static/js/main.js), you put in models
>
> response.static_version_urls = True
> response.static_version = '0.0.1'
>
> and voilà, at the first time a user accesses your page, the upstream proxy 
> will fetch the resource ONCE and serve it FOREVER.
> 

Re: [web2py] How to get and use attributes from Active Directory

2015-09-16 Thread Laurent Lc
In fact i connect people of the institue withe my AD abd web2py, but i'd 
like to use attributes to prefill forms for example.


Le mercredi 16 septembre 2015 04:39:00 UTC+2, Richard a écrit :
>
> Can you be more specific?
>
> Do you want to manage group from AD inside web2py?
>
> Richard
>
> On Mon, Sep 14, 2015 at 4:38 PM, Laurent Lc  > wrote:
>
>> i am looking for a very simple example
>> thanks
>>
>> -- 
>> 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.


[web2py] Re: Web2py - Front-end performance optimization tutorial

2015-09-16 Thread Niphlod

>
>
>>
> Interesting point : using public CDNs for open-source resources vs 
> bundling them with your own code ?
>
> I will have to disagree on public CDNs being more reliable that private 
> ones. It's just mathematically wrong.
> Public CDNs like cdnjs for instance will give an unstable bandwidth, 
> depending on the load they get, which you can't measure beforehand.
> Owning your own high-end CDN guarantees you will have a constant bandwidth.
>

This is true only if you use a public CDN which isn't used by anyone else: 
which kinda invalidates the whole "public CDN": their high value is that 
the user in 99% of the cases doesn't have to download anything at all. 
Are you really stating that your own CDN serving jquery is better 
than https://code.jquery.com/jquery-2.1.4.min.js , both for SLA and speed ? 
 

>
> In terms of load speed, it's usually better to have one optimised bundle 
> than having to load multiple resources.
> In terms of project management, it's also easier to manage one bundle than 
> handling vendors & private code separately.
>
> If you don't want to take my word for it, just have a look at big websites 
> around : they all resort to bundling.
>

Again, this was covered multiple times, even in this forum, and if you're 
in the 10-15 files ballpark, serving 2 bundles vs 15 from public cdn 
improves the load time by less than 20 msec. Bonus points for cdns because 
they don't waste YOUR bandwith, nor the users's...
 

>  
>
>> - dynamic assets: again, minification and bundling to a CDN are not 
>> really web2py's job but at most for a script. Use whatever you'd like
>>
>
> Minification & bundling are not web2py's job, but versioning & caching 
> should be. 
>  
>
>> - dynamic images: if you're going to serve them a lot, don't compress 
>> on-the-fly. Compress either at first-access, then serve at nth access, or 
>> compress with an async task.
>>
>
> The easy answer here is to compress & save into a file (for instance on 
> Amazon S3). That would work just fine for most projects.
>
> I'm working on an alternative solution these days : argument-based, on the 
> fly image pre-processing with a cache proxy.
>
> For instance, a request to "
> http://website.com/download/picture.png?width=200=300; could be 
> processed on the fly and served behind a CDN for caching. The CDN would 
> ensure that you process this image for this size only once, negating the 
> CPU overhead. This kind of structure is more flexible than fixed-size files.
>

you can also use a SaaS for it. see https://www.resrc.it/ .
 

>  
>
>> - html minification: I'd really like to see a gzipped response (which is 
>> the 90% gain) confronted to a minified-gzipped response (which would be the 
>> 10% gain). I don't see it in the wild and frankly I wouldn't spend cpu on 
>> it. Just gzip it
>>
>
> Most of the gain does come from compression. Minfiication... will depend 
> on how you structure your code I guess.
>
> In my case, minification helped achieve roughly 1KB after compression so 
> nothing fancy. I have no figures about the CPU overhead though but I'd be 
> interested if anyone has them.
>

Glad we agree on its utter unusefulness.
 

>  
>
>> - cache headers: use @cache.action: it's specifically coded for it
>>
>
> Yes & no.
> In Python, we tend to think explicit > implicit.
>
> @cache.action is a sweet helper, but it does everything implicitly so you 
> don't really understand or control what you're doing.
>
> Practically speaking, I had to stray from it because it's lacking the 
> "Access-Control-Allow-Origin" header, which is mandatory for CORS 
> management.
>

Not every page needs to be available for CORS. The fact that for everything 
else works out of the box IMHO is a big win.
 

> It also doesn't set the "Last-Modified" header which is important if you 
> want to leverage browser-side caching (304 responses).
>

The browser doesn't even think to re-request something if it has been 
served with an expires set in the future, so I really dont' see the point 
of leveraging Last-Modified (or even Etag, for that matter)
 

>  
>
>> - web2py's versioning system: it's hardly "even close to blablabla". 
>> web2py's versioning system is specifically engineered to work with CDNs and 
>> upstream proxyies. 
>>
>> On the last point, I really have to see a simpler develop-to-prod 
>> deployment.
>> Probably it's you not grasping it, the docs feel quite clear you 
>> develop whatever you need, you create your main.js and main.css with 
>> whatever build system you'd like, leave the files in the static folder 
>> (e.g. /static/css/main.css, /static/js/main.js), you put in models
>>
>> response.static_version_urls = True
>> response.static_version = '0.0.1'
>>
>> and voilà, at the first time a user accesses your page, the upstream 
>> proxy will fetch the resource ONCE and serve it FOREVER.
>> Need to correct a small issue with your main.css ? Edit it, save it over 
>> /static/css/main.css, change 
>>
>> 

[web2py] Re: sql query

2015-09-16 Thread Laurent Lc
Thank you for your qick answer.
Ok i understand.
Yes it works if use:

for row in dbRH(dbRH.test.login=="Laurent").select():
firstname = row.firstname


but the problem is that i would to use the var "auth.user.username" for my 
request and i don't know how to do

Le mercredi 16 septembre 2015 13:26:16 UTC+2, Mirek Zvolský a écrit :
>
> I don't know what SQLField() means, I use Field() instead.
>
> The variable loginsession is defined at the python level. SQL level will 
> nothing know about it.
> So you run really the SQL command: "SELECT ... WHERE login=loginsession;".
> Try same command in MySQL manager, it will not work because loginsession 
> is unkown.
>
> Do you really need run raw SQL commands (with .executesql())?
> Isn't better way use a DAL abstraction language like
>   dbRH(dbRH.test.id>0).select()
> or
>   dbRH(dbRH.test.login=="Laurent").select()
> ?
>
>
>
> Dne středa 16. září 2015 12:34:09 UTC+2 Laurent Lc napsal(a):
>>
>> Hi 
>> could you explain me why it does not work :
>> my file db.py (a part of file)
>>
>> loginsession = auth.user.username
>> dbRH = DAL('mysql://xxx:xxx@localhost/RH', pool_size=0)
>> dbRH.define_table('test',
>> SQLField('login', type = 'string' , length = 20 ),
>> SQLField('nom', type = 'string' , length = 20 ),
>> SQLField('prenom', type = 'string' , length = 20 ),
>> SQLField('groupe', type = 'string' , length = 15 ),
>> SQLField('mail', type = 'string' , length = 50 ),
>> migrate = False)
>> query='SELECT * from test WHERE login=loginsession'
>> firstname =dbRH.executesql(query,as_dict=True)
>>
>> If i replace the var loginsession by "toto", it works and the var 
>> loginsession has a value ...
>>
>> Another question about DAL if i follow the doc :
>> #q=dbRH.test.login==loginsession
>> #s=db(q)
>> #rows=s.select()
>> #for row in rows:
>> #prenom = row.prenom
>>
>> does not run too ...
>>
>>
>> Thank you in advance 
>> Regards,
>>
>>
>>
>>

-- 
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][OT] Workflow

2015-09-16 Thread António Ramos
My company and many others would buy a web workflow framework. for example
a Workflow as a service...

We dont want blogs we want real enterprise tools.

2015-09-16 3:11 GMT+01:00 Richard Vézina :

> I thought it could be used for workflow management...
>
> Richard
>
> On Tue, Sep 15, 2015 at 4:33 PM, Niphlod  wrote:
>
>>
>>
>> On Tuesday, September 15, 2015 at 7:16:08 PM UTC+2, Richard wrote:
>>>
>>> I should try it, you right, it on my todo since a lot of time... But
>>> eventually, I will need workflow not exactly related to task, but for
>>> general purpose...
>>>
>>
>> got distracted.why mentioning luigi then ?
>>
>> if you need general purpose unrelated to tasks, use SpiffWorkflow or
>> fysom.
>>
>> --
>> 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.
>

-- 
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: sql query

2015-09-16 Thread Mirek Zvolský
I don't know what SQLField() means, I use Field() instead.

The variable loginsession is defined at the python level. SQL level will 
nothing know about it.
So you run really the SQL command: "SELECT ... WHERE login=loginsession;".
Try same command in MySQL manager, it will not work because loginsession is 
unkown.

Do you really need run raw SQL commands (with .executesql())?
Isn't better way use a DAL abstraction language like
  dbRH(dbRH.test.id>0).select()
or
  dbRH(dbRH.test.login=="Laurent").select()
?



Dne středa 16. září 2015 12:34:09 UTC+2 Laurent Lc napsal(a):
>
> Hi 
> could you explain me why it does not work :
> my file db.py (a part of file)
>
> loginsession = auth.user.username
> dbRH = DAL('mysql://xxx:xxx@localhost/RH', pool_size=0)
> dbRH.define_table('test',
> SQLField('login', type = 'string' , length = 20 ),
> SQLField('nom', type = 'string' , length = 20 ),
> SQLField('prenom', type = 'string' , length = 20 ),
> SQLField('groupe', type = 'string' , length = 15 ),
> SQLField('mail', type = 'string' , length = 50 ),
> migrate = False)
> query='SELECT * from test WHERE login=loginsession'
> firstname =dbRH.executesql(query,as_dict=True)
>
> If i replace the var loginsession by "toto", it works and the var 
> loginsession has a value ...
>
> Another question about DAL if i follow the doc :
> #q=dbRH.test.login==loginsession
> #s=db(q)
> #rows=s.select()
> #for row in rows:
> #prenom = row.prenom
>
> does not run too ...
>
>
> Thank you in advance 
> Regards,
>
>
>
>

-- 
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 - Front-end performance optimization tutorial

2015-09-16 Thread Anthony

>
> I will have to disagree on public CDNs being more reliable that private 
> ones. It's just mathematically wrong.
> Public CDNs like cdnjs for instance will give an unstable bandwidth, 
> depending on the load they get, which you can't measure beforehand.
> Owning your own high-end CDN guarantees you will have a constant bandwidth.
>

Let's distinguish between three types of CDNs: (1) public CDN hosting 
existing open source projects, such as 
https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js, (2) 
public CDN hosting your own custom assets (e.g., your own Cloudflare 
account), (3) private CDN (i.e., build your own POP infrastructure, or use 
a service like Fastly ).

When you refer to "private" and "owning your own," are you talking about #2 
or #3? For #3, even though there is potential for better performance 
(depending on how "high-end" you go), there is also obviously going to be 
greater cost as well, so you have to consider the tradeoffs. Furthermore, 
even #3 may be slower than #1 for highly popular open source libraries such 
as jQuery, as in the case of #1, the resource is likely to be in the user's 
browser cache already due to a previous visit to some other website using 
the same public CDN.

If you were comparing #1 to #2, it's not clear which would be faster (do 
you have some data?). For example, cdnjs is hosted by Cloudflare, so not 
sure hosting your own version of the asset on Cloudflare would necessarily 
beat cdnjs.
 

> In terms of load speed, it's usually better to have one optimised bundle 
> than having to load multiple resources.
> In terms of project management, it's also easier to manage one bundle than 
> handling vendors & private code separately.
>

I think niphlod agrees, but depending on your site and infrastructure, it 
may still be better to use public versions of a few highly popular 
libraries, such as jQuery and Boostrap (due to the likelihood of 
pre-existing copies already being in the browser cache, as mentioned above).
 

> If you don't want to take my word for it, just have a look at big websites 
> around : they all resort to bundling.
>

Keep in mind that the most popular websites likely have their own private 
CDNs (which is cost effective for them, but probably not for your web2py 
site), and they may be popular enough that they would benefit little from 
pre-existing cached copies of libraries in the user's browser (because 
their own copy of the resource is just as likely to be in the browser cache 
as well).
 

>  
>
>> - dynamic assets: again, minification and bundling to a CDN are not 
>> really web2py's job but at most for a script. Use whatever you'd like
>>
>
> Minification & bundling are not web2py's job, but versioning & caching 
> should be.
>

Well, generally it is likely to be faster to have the web server (e.g., 
nginx) serve the static assets directly, as web2py will add additional 
overhead. As long as web2py isn't handling the static requests, though, it 
can't handle caching, and it isn't clear it should be involved in 
versioning either. 
 

> - cache headers: use @cache.action: it's specifically coded for it
>>
>
> Yes & no.
> In Python, we tend to think explicit > implicit.
>
> @cache.action is a sweet helper, but it does everything implicitly so you 
> don't really understand or control what you're doing.
>

If "does everything implicitly" means you can't see everything the function 
does merely by looking at the function call, then this is true of virtually 
any function, and the notion that "explicit > implicit" becomes 
meaningless. Using any function requires some understanding of what it does 
and doesn't do (via reading the docs, inspection of the code, or 
observation of the output).
 

> Practically speaking, I had to stray from it because it's lacking the 
> "Access-Control-Allow-Origin" header, which is mandatory for CORS 
> management.
>

@cache.action sets headers specfically relevant to browser caching, so 
Access-Control-Allow-Origin is out of scope. However, if you are using 
@cache.action, nothing prevents you from setting other response headers by 
the usual means -- you have just as much control over the headers with or 
without that decorator.

I think it would be sweet if web2py could adapt to existing bundling 
> systems out there.
> Here's how I managed using a manifest-based system in web2py :
>

I'm not sure this belongs in the core, as we don't want to have to worry 
about supporting any possible manifest format, but could be a useful 
contrib package.

Anthony

-- 
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] sql query

2015-09-16 Thread Laurent Lc
Hi 
could you explain me why it does not work :
my file db.py (a part of file)

loginsession = auth.user.username
dbRH = DAL('mysql://xxx:xxx@localhost/RH', pool_size=0)
dbRH.define_table('test',
SQLField('login', type = 'string' , length = 20 ),
SQLField('nom', type = 'string' , length = 20 ),
SQLField('prenom', type = 'string' , length = 20 ),
SQLField('groupe', type = 'string' , length = 15 ),
SQLField('mail', type = 'string' , length = 50 ),
migrate = False)
query='SELECT * from test WHERE login=loginsession'
firstname =dbRH.executesql(query,as_dict=True)

If i replace the var loginsession by "toto", it works and the var 
loginsession has a value ...

Another question about DAL if i follow the doc :
#q=dbRH.test.login==loginsession
#s=db(q)
#rows=s.select()
#for row in rows:
#prenom = row.prenom

does not run too ...


Thank you in advance 
Regards,



-- 
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 - Front-end performance optimization tutorial

2015-09-16 Thread Louis Amon

>
> Are you really stating that your own CDN serving jquery is better than 
> https://code.jquery.com/jquery-2.1.4.min.js , both for SLA and speed ? 

 
That is not what I said.
First of all, this whole "put vendors in bundle or not" issue only concerns 
the first request of a visitor, as any subsequent request should have 
common resources (like jQuery for instance) cached by the browser.
As such, it is a minor performance boost : so it is more of a distribution 
architecture & SLA issue.

Using a public CDN puts you at the mercy of the CDN service in terms of 
SLA. Multiplying public CDNs (e.g. one for bootstrap, one for jquery, cdnjs 
for other JS resources...) means you multiply your SLA as well, which is a 
bad thing.

To be more practical : if your code relies on AngularJS for instance, then 
you would only benefit from using a public CDN if your visitor has 
previously visited an Angular-based website that uses Google's public CDN 
and the exact same version of Angular that the one you are using. That's a 
bit far-fetched.
Same goes for all JS frameworks you might use (including jQuery which, 
indeed, is much more widely distributed).

All in all, I'm stating that private CDNs are easier to manage and more 
reliable, but performance-wise there isn't much to be gained regarding 
vendors.

@Anthony: when I said "private" I meant a Cloudflare account, so #2


Using static_version "rebuilds" all URLs automatically, but it's perfectly 
> fine to serve static from "different" versions alltogether.


Interesting.
So it is in fact possible to create your own versioning system in web2py by 
creating a helper that dynamically builds a static file's URL based on its 
checksum (or any other unique tag).
This way you benefit from automatically set Cache-Control headers.

I also noticed in the source code that puting main.css.gz in the same 
directory as main.css will automatically serve the gzipped version with the 
correct headers : that's pretty sweet.
I didn't know about it before though (it isn't documented), so I built my 
own gzip management.

Basically, I'm not disputing the fact that web2py is built with a lot of 
interesting features (batteries included).
What I do regret is the lack of settings that would allow you to customize 
/ overwrite / extend these features when you come to outscale them.

One size doesn't always fit all.

-- 
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] Issue with routes.py and subdomains

2015-09-16 Thread rwernet . ae2i
Hello everybody,

I am trying to route 2 subdomains to web2py through apache

Here is the config :
- Apache 2.4 routing to https://www.sub1.domain.com AND 
https://www.sub2.domain.com (certificate is currently self-signed for 
development purposes)
- In fact "www.sub1.domain.com" and "www.sub2.domain.com" start the 
same web2py instance through wsgihandler.py
- Then I am currently trying to route subdomains "www.sub1.domain.com" 
to "app1" AND "www.sub2.domain.com" to "app2"

Here is my routes.py :

routers = dict{
   BASE = dict{
domains = {
   'www.sub1.domain.com'  : 'app1',
   'www.sub2.domain.com'  : 'app2',
 }
   },
 }

In this configuration, app1 works and app2 crashes with exception 
"getattr() : attribute name must be string"

When I invert the 2 domain lines (app2 declared first, then app1), then 
app2 works, and app1 crashes

It is always the app declared first that works, and app declared second 
that crashes

On top of this, when I again declare app1 first and app2 second, 
www.sub1.domain.com works, and www.sub2.domain.com crashes (as expected 
with first tests), BUT www.sub1.domain.com/app2 works !!!

It means that apps are OK, but routing somehow is generating this behavior

Does anyone has an idea of what is wrong in my settings, and how I could 
fix this ?

Thanks in advance
Regis Wernet

-- 
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] Logger works locally but not when deployed to a server

2015-09-16 Thread Mike Cole
I'm at a loss here.  I've created a model named log.py, which contains:

import logging
logger = logging.getLogger(request.application)
logger.setLevel(logging.DEBUG)

I copied logging.example.conf to my web2py folder and renamed it to 
logging.conf and added myapp to the end of keys, then added the following 
code for the handler:

# myapp app handler
[logger_myapp]
level=DEBUG
handlers=consoleHandler,rotatingFileHandler
qualname=web2py.app.myapp
propagate=0

In default.py I've added a couple of logging statements similar to thie:

logger.debug("Entering status_check() - logging test")

When I run this locally, I see a file created at ./web2py/logs/web2py.log. 
 However, when I deploy this same code to my server, I get nothing.  I went 
so far as to create that file manually and chmod 777 the file to see if I 
had some silly permissions issue, and I see nothing.  

I'm running web2py's built in server via a cronjob like this:

@reboot python /home/mike/web2py/web2py.py -i 0.0.0.0 -p 80 -a 
""

The reason I'm adding the logging is because I was trying to run a 
subprocess in order to ping a certain set of URL's to check their status 
upon a page load, using nping, and was having the same problem with that 
(subprocess runs fine on local machine, but is not running correctly on 
server).  

Ideas and suggestions would be appreciated.  Thanks!

Of note, all references to "myapp" above are actually named for the correct 
application name, not just the text "myapp".

-- 
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] XML pickle/unpickle

2015-09-16 Thread Maxim Hrustalev
Does anyone with deep knowledge of web2py know why this code is included in 
html.py

667 ### important to allow safe session.flash=T()
668
669
670 def XML_unpickle(data):
671 return marshal.loads(data)
672
673
674 def XML_pickle(data):
675 return XML_unpickle, (marshal.dumps(str(data)),)
676 copy_reg.pickle(XML, XML_pickle, XML_unpickle)


Is it safe to comment it out? I did and didn't find any problems. The 
problem is that it doesn't allow to use html tags with session.flash.

-- 
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: We do not delete posts

2015-09-16 Thread Maxim Hrustalev
Dear moderators,

How many posts do I need to post to be added to white list? Is it just bad 
luck or what?

Thnx

On Monday, July 20, 2015 at 11:08:57 AM UTC+3, Massimo Di Pierro wrote:

> We never delete posts from users, unless the users ask (because they 
> accidentally post the server password, for example). Yet first posts are 
> moderated to avoid spam. Usually when a post is on hold for moderation it 
> is approved within 24 hours or less.
>
> There are some glitches in the process. 
> - Occasionally some posts have disappeared on their own. We attributed 
> this to a Google glitch. It has not happened recently. 
> - Some times Google requires moderation even for posts from people that 
> have been whitelisted. This is not our policy and we do not know why it 
> happens, but it does. 
> - Some posts have erroneously been flagged as spam by moderators. We can 
> fix this.
> - Some times it takes longer then 24 hrs for a post to be moderated, but 
> never more than 48 hrs.
> These problems are very very rare.
>
> If your first post does not show up, then it is moderated. Just wait. Do 
> not post 10 more copies of it. That just calls for trouble and more work 
> for all of us. If your post does not show up in 24 hours, email me 
> personally and I will take a look.
>
> We could use some more moderators, so feel free to volunteer by emailing 
> me.
>
> Fun fact: 90% of spam posts are job announcements about Java.
>
> 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] Self-referencing tables and queries

2015-09-16 Thread Carla Raquel
Hello,

I'm currently tring to solve a problem regarding a table da references 
itself. The default auth_user table has an extra field called 'Supervisor' 
that references that same table, since Supervisor is an user(a 
specialization of it,to be more specific).I have the following parameters 
added on db.py:

auth.settings.extra_fields['auth_user']= [Field('Supervisor','reference 
auth_user')]
db.auth_user.Supervisor.requires=IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id',db.auth_user._format))

I also have another table that stores the user' numbers like so:

db.define_table('Extension',
Field('Person' ,db.auth_user, requires = 
 IS_IN_DB(db,'auth_user.id')),
Field('Supervisor' ,db.auth_user, requires = 
IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id','%(first_name)s %(last_name)s'))),
Field('Extension_number','integer',required = True))

I've tried to query my db for the extension of a person which is a 
supervisor like this:

query = ((db.auth_user.id == db.Extension.Person) & 
(db.auth_user.first_name == fname) & (db.auth_user.last_name == lname) & 
(~(db.Extension.Extension.like('9%'

The problem is, all the extensions associated with the supervisor (both his 
and the people he is a supervisor) are returned. This is wrong, since I 
only want his extensions and not those from the people he is a supervisor. 
What I'm I possibly missing on my query to make this work?  I hope I have 
made any sense here.


-- 
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: XML pickle/unpickle

2015-09-16 Thread Massimo Di Pierro
The reason is that is allows storing variables that contain XML('.') in 
sessions. That is useful to deal with flash messages that contain more than 
just text.

On Wednesday, 16 September 2015 08:42:55 UTC-5, Maxim Hrustalev wrote:
>
> Does anyone with deep knowledge of web2py know why this code is included 
> in html.py
>
> 667 ### important to allow safe session.flash=T()
> 668
> 669
> 670 def XML_unpickle(data):
> 671 return marshal.loads(data)
> 672
> 673
> 674 def XML_pickle(data):
> 675 return XML_unpickle, (marshal.dumps(str(data)),)
> 676 copy_reg.pickle(XML, XML_pickle, XML_unpickle)
>
>
> Is it safe to comment it out? I did and didn't find any problems. The 
> problem is that it doesn't allow to use html tags with session.flash.
>

-- 
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: We do not delete posts

2015-09-16 Thread Massimo Di Pierro
Apologies. Either we did a mistake a mistake when moderating your previous 
posts (click on wrong button) or google is acting up (has happened before). 
I did whitelist you again this time. Finger crossed!


On Wednesday, 16 September 2015 08:42:58 UTC-5, Maxim Hrustalev wrote:
>
> Dear moderators,
>
> How many posts do I need to post to be added to white list? Is it just bad 
> luck or what?
>
> Thnx
>
> On Monday, July 20, 2015 at 11:08:57 AM UTC+3, Massimo Di Pierro wrote:
>
>> We never delete posts from users, unless the users ask (because they 
>> accidentally post the server password, for example). Yet first posts are 
>> moderated to avoid spam. Usually when a post is on hold for moderation it 
>> is approved within 24 hours or less.
>>
>> There are some glitches in the process. 
>> - Occasionally some posts have disappeared on their own. We attributed 
>> this to a Google glitch. It has not happened recently. 
>> - Some times Google requires moderation even for posts from people that 
>> have been whitelisted. This is not our policy and we do not know why it 
>> happens, but it does. 
>> - Some posts have erroneously been flagged as spam by moderators. We can 
>> fix this.
>> - Some times it takes longer then 24 hrs for a post to be moderated, but 
>> never more than 48 hrs.
>> These problems are very very rare.
>>
>> If your first post does not show up, then it is moderated. Just wait. Do 
>> not post 10 more copies of it. That just calls for trouble and more work 
>> for all of us. If your post does not show up in 24 hours, email me 
>> personally and I will take a look.
>>
>> We could use some more moderators, so feel free to volunteer by emailing 
>> me.
>>
>> Fun fact: 90% of spam posts are job announcements about Java.
>>
>> 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] Re: XML pickle/unpickle

2015-09-16 Thread Leonel Câmara
Why do you want comment it out anyway?

-- 
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] SQL select with a var

2015-09-16 Thread Laurent Lc
when the request is written like this :

for row in dbRH(dbRH.test.login=="Laurent").select():
firstname = row.firstname

It works .

Now i want to replace "Laurent" by" myvar" and it doesn't work , how to do 
please help. It should be very simple but but .. it still doesn't work for 
me

-- 
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 SPA(single page application)

2015-09-16 Thread Márcio Almeida
Thank you, I will study it.
If anyone has more information, please post.

Em segunda-feira, 14 de setembro de 2015 22:14:53 UTC-3, Márcio Almeida 
escreveu:
>
> Hi, I'm trying to create a spa-like application to not reload it whenever 
> you change page, I tried example of web2pyslices but
> only charges the index page, the other I did not know how to load (
> http://www.web2pyslices.com/slice/show/2030/creating-a-single-page-app-with-web2py
> ).
> Has anyone had any experience with this or know how to evolve the example 
> of web2pyslices?
> Some solution in web2py?
> I think some will tell me about angularjs etc, okay with it gives, but did 
> not want to mix things up, native web2py does it have any way out?
>
> Thanks people.
>

-- 
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] Adding class='hidden' creates an element style='display: none'

2015-09-16 Thread Stuart Rolinson
When I create an item directly in the html form with a class ='hidden' for 
use with bootstrap, web2py appears to be rendering an additional element 
style "display:none" which stops bootstrap functionality working correctly.

Raw HTML:


  Select 
County
  
 

Rendered HTML:


  Select 
County
  


Is this correct behaviour?  I don't think it should be doing this.

Thanks,
Stuart

-- 
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: SQL select with a var

2015-09-16 Thread Leonel Câmara
What do you mean it doesn't work? Can you show us how you tried to replace 
it?

-- 
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: SQL select with a var

2015-09-16 Thread Laurent Lc
like this :
myvar="toto"
for row in dbRH(dbRH.test.login==myvar).select():
firstname = row.firstname

the sql request doesn't work beacause myvar does not exist in sql but in 
python. so i don't know how to do



Le mercredi 16 septembre 2015 16:20:11 UTC+2, Leonel Câmara a écrit :
>
> What do you mean it doesn't work? Can you show us how you tried to replace 
> it?
>

-- 
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: web2py SPA(single page application)

2015-09-16 Thread António Ramos
My favourite is Vuejs
learn from here

http://vuejs.org/guide/
https://laracasts.com/series/learning-vuejs
you can go very crazy with it


2015-09-16 15:05 GMT+01:00 Márcio Almeida 
:

> Thank you, I will study it.
> If anyone has more information, please post.
>
> Em segunda-feira, 14 de setembro de 2015 22:14:53 UTC-3, Márcio Almeida
> escreveu:
>>
>> Hi, I'm trying to create a spa-like application to not reload it whenever
>> you change page, I tried example of web2pyslices but
>> only charges the index page, the other I did not know how to load (
>> http://www.web2pyslices.com/slice/show/2030/creating-a-single-page-app-with-web2py
>> ).
>> Has anyone had any experience with this or know how to evolve the example
>> of web2pyslices?
>> Some solution in web2py?
>> I think some will tell me about angularjs etc, okay with it gives, but
>> did not want to mix things up, native web2py does it have any way out?
>>
>> Thanks people.
>>
> --
> 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: Self-referencing tables and queries

2015-09-16 Thread Leonel Câmara
This is the answer to the first problem:

db.auth_user.Supervisor.requires=IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id',
db.auth_user._format))

You can just remove it as it will use the format for auth_user anyway as 
that's the default. So it becomes only:

db.auth_user.Supervisor.requires=IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id')

As for the Extensions I'm very confused with what you're trying to achieve 
and your table structure doesn't seem very good. Would it make more sense 
to have it like this?

db.define_table('extension',,
Field('Supervisor' , 'reference auth_user', requires = 
IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id','%(first_name)s %(last_name)s'))),
Field('Extension_number','integer',required = True))

db.define_table('extension_member',
Field('extension' , 'reference extension'),
Field('member' , 'reference auth_user'),


I ask this because your query is utterly confusing, why would you check the 
first name and last name when you already compared the ID with person, why 
would you use "like" for an integer field. So many questions.

In your questions you need to tells us *what* you're trying to achieve not 
just *how*.

-- 
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: SQL select with a var

2015-09-16 Thread Anthony
On Wednesday, September 16, 2015 at 10:33:39 AM UTC-4, Laurent Lc wrote:
>
> like this :
> myvar="toto"
> for row in dbRH(dbRH.test.login==myvar).select():
> firstname = row.firstname
>
> the sql request doesn't work beacause myvar does not exist in sql but in 
> python. so i don't know how to do
>

Yes, myvar is a Python variable, but then again, it is being used in Python 
code, so no problem there. The DAL will convert that to the appropriate SQL 
statement. Are you sure that is your *exact* code? How are you determining 
whether it "works"? I suspect you have a problem elsewhere.

Anthony

-- 
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: SQL select with a var

2015-09-16 Thread Laurent Lc
yes copy/paste
it works because in the view associated i can see the var "firstname"

Le mercredi 16 septembre 2015 16:48:19 UTC+2, Anthony a écrit :
>
> On Wednesday, September 16, 2015 at 10:33:39 AM UTC-4, Laurent Lc wrote:
>>
>> like this :
>> myvar="toto"
>> for row in dbRH(dbRH.test.login==myvar).select():
>> firstname = row.firstname
>>
>> the sql request doesn't work beacause myvar does not exist in sql but in 
>> python. so i don't know how to do
>>
>
> Yes, myvar is a Python variable, but then again, it is being used in 
> Python code, so no problem there. The DAL will convert that to the 
> appropriate SQL statement. Are you sure that is your *exact* code? How 
> are you determining whether it "works"? I suspect you have a problem 
> elsewhere.
>
> Anthony
>

-- 
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: Adding class='hidden' creates an element style='display: none'

2015-09-16 Thread Leonel Câmara
web2py.js does that, I think it's because of appadmin using class hidden 
and since appadmin uses your app's layout it may not have the css saying 
it's supposed to be display:none, but to be frank I'm not sure. You can 
just delete the line that does it that looks like this because bootstrap 
already has the hidden display: none style.

$('.hidden', target).hide();


 

-- 
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: Self-referencing tables and queries

2015-09-16 Thread Carla Raquel
I guess my code is  more messed up than I thought. I'll try and clarify 
your points:

*What am I trying to achieve?*

In the db there are people (given by the auth_user table). From those 
people there are ones who are hierarchically above them and supervise 
them.They are called Supervisors. All people have mobile and phone 
extensions(numbers) . As far as my query goes, I'm getting the Supervisor' 
numbers and the people's numbers associated with the Supervisor. What I'm 
trying to accomplish: returning only the Supervisor' numbers.

*Would it make more sense to have it like this?*

I'm curious,why would a second table(extension_member) be needed?I think I 
will also need the extension_number in the 'extension' table since that 
table stores all the phone and mobile extensions.

*Why would you check the first name and last name when you already compared 
the ID with person?*

Now I am the one a bit confused. The comparison between the ID and the 
person was to connect both tables and then I would filter by the user I 
wanted. But now I'm not sure If I've been doing this correctly...? 

*Why would you use "like" for an integer field?*

It's the only way I know to check if a number begins as 9 or ~9 . Is there 
a simpler/optimised way?Also, as an aside, is there a way to use regular 
expressions in queries?

Thank you for all the help!

quarta-feira, 16 de Setembro de 2015 às 15:18:31 UTC+1, Leonel Câmara 
escreveu:
>
> This is the answer to the first problem:
>
> db.auth_user.Supervisor.requires=IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id',
> db.auth_user._format))
>
> You can just remove it as it will use the format for auth_user anyway as 
> that's the default. So it becomes only:
>
> db.auth_user.Supervisor.requires=IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id')
>
> As for the Extensions I'm very confused with what you're trying to achieve 
> and your table structure doesn't seem very good. Would it make more sense 
> to have it like this?
>
> db.define_table('extension',,
> Field('Supervisor' , 'reference auth_user', requires = 
> IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id','%(first_name)s %(last_name)s'))),
> Field('Extension_number','integer',required = True))
>
> db.define_table('extension_member',
> Field('extension' , 'reference extension'),
> Field('member' , 'reference auth_user'),
> 
>
> I ask this because your query is utterly confusing, why would you check 
> the first name and last name when you already compared the ID with person, 
> why would you use "like" for an integer field. So many questions.
>
> In your questions you need to tells us *what* you're trying to achieve 
> not just *how*.
>

-- 
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] Initialize vars

2015-09-16 Thread lenin . martinez
Hello i need initialize 


*request.vars, or request.post_vars etc... im alredy tried the following 
codes*
   
   - *request.vars = None*
   - *request.vars = Nan*
   - *request.vars = {}*
   - *request.vars = ''*

*And nothing yet. thank's*

-- 
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: Self-referencing tables and queries

2015-09-16 Thread Carla Raquel
*They should be strings (otherwise how do you store the '+' character)*.

I think in this case they won't be strings since I read the numbers from a 
XML and they don't have the '+' character.

*Then you want to get the extensions of all the supervisors? *

Not all the supervisors.I want to get the extensions of a particular 
supervisor (hence I had the first and last name in the query). Something 
like this:  when a user logs in the system checks who has logged in and 
feeds a table with info(calls details,extensions,etc.) about the specific 
user, who can be a supervisor or a regular person.

quarta-feira, 16 de Setembro de 2015 às 17:09:48 UTC+1, Leonel Câmara 
escreveu:
>
> Ohh ok I had no idea extensions were phone numbers, phone numbers should 
> not be integers, they should be strings (otherwise how do you store the '+' 
> character). Then extensions should be just this:
>
> db.define_table('Extension',
> Field('Person' ,db.auth_user, requires =  IS_IN_DB(db,'
> auth_user.id')),
> Field('Extension_number','string',required = True))
>
> There's no need for an extension to have a supervisor, because the 
> supervisor is already stored in Person. 
>
> Then you want to get the extensions of all the supervisors? (did I get 
> that right)
>
> The easiest way would then be to use belongs:
>
> supervisors = db(db.auth_user.id  > 
> 0)._select(db.auth_user.Supervisor, distinct=True)
> supervisor_extensions = 
> db(db.Extension.Person.belongs(supervisors)).select()
>
> This way you will have the extensions of all the supervisors.
>

-- 
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: Adding class='hidden' creates an element style='display: none'

2015-09-16 Thread Anthony
What Bootstrap functionality is broken by this?

On Wednesday, September 16, 2015 at 9:42:55 AM UTC-4, Stuart Rolinson wrote:
>
> When I create an item directly in the html form with a class ='hidden' for 
> use with bootstrap, web2py appears to be rendering an additional element 
> style "display:none" which stops bootstrap functionality working correctly.
>
> Raw HTML:
>
> 
>for='slctCounty'>Select County
>   
>  
>
> Rendered HTML:
>
> 
>for="slctCounty">Select County
>   
> 
>
> Is this correct behaviour?  I don't think it should be doing this.
>
> Thanks,
> Stuart
>

-- 
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: Initialize vars

2015-09-16 Thread Anthony
request.vars is already initialized to a gluon.storage.Storage object. If 
it is not empty but you want to empty it, you can do:

request.vars.clear()

Anthony

On Wednesday, September 16, 2015 at 11:54:38 AM UTC-4, 
lenin.marti...@metamaxzone.com wrote:
>
> Hello i need initialize 
>
>
> *request.vars, or request.post_vars etc... im alredy tried the following 
> codes*
>
>- *request.vars = None*
>- *request.vars = Nan*
>- *request.vars = {}*
>- *request.vars = ''*
>
> *And nothing yet. thank's*
>

-- 
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: Self-referencing tables and queries

2015-09-16 Thread Leonel Câmara
Ohh ok I had no idea extensions were phone numbers, phone numbers should 
not be integers, they should be strings (otherwise how do you store the '+' 
character). Then extensions should be just this:

db.define_table('Extension',
Field('Person' ,db.auth_user, requires =  IS_IN_DB(db,'
auth_user.id')),
Field('Extension_number','string',required = True))

There's no need for an extension to have a supervisor, because the 
supervisor is already stored in Person. 

Then you want to get the extensions of all the supervisors? (did I get that 
right)

The easiest way would then be to use belongs:

supervisors = db(db.answer.id > 0)._select(db.auth_user.Supervisor, 
distinct=True)
supervisor_extensions = 
db(db.Extension.Person.belongs(supervisors)).select()

This way you will have the extensions of all the supervisors.

-- 
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: Initialize vars

2015-09-16 Thread Leonel Câmara
why?

-- 
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][OT] Workflow

2015-09-16 Thread Dave S


On Wednesday, September 16, 2015 at 4:01:19 AM UTC-7, Ramos wrote:
>
> My company and many others would buy a web workflow framework. for example 
> a Workflow as a service...
>
> We dont want blogs we want real enterprise tools.
>

What's missing from SpiffWorkflow?  The documentation looks fairly 
professional (at a quick glance).

 

Fysom is a finite state machine generator.  Workflow processes can be 
mapped to the transitions, I guess, and outputs to the states.  I'd have to 
think about how to set it up for meeting multiple requirements on the 
inputs; probably using substates to match the set of requirements; from the 
super state, that would look inputs casuing a transition to self until all 
inputs were present.  I haven't done that for workflow, but some device 
drivers had that sort of FSM within an FSM (device discovery, for instance).



On Tue, Sep 15, 2015 at 4:33 PM, Niphlod  
>> wrote:
>>
>>>
>>> [...] 
>>> if you need general purpose unrelated to tasks, use SpiffWorkflow or 
>>> fysom.
>>>
>>>
>>>
>  

/dps

-- 
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: Self-referencing tables and queries

2015-09-16 Thread Dave S


On Wednesday, September 16, 2015 at 10:15:53 AM UTC-7, Leonel Câmara wrote:
>
> > I think in this case they won't be strings since I read the numbers from 
> a XML and they don't have the '+' character
>
> So what? You should future proof the app. Some day there might be 
> extensions in India or something.
>
> > Not all the supervisors.I want to get the extensions of a particular 
> supervisor
>
> Do you mean the extensions of the persons he supervises?
>

Didn't Carla say that was what she was already getting?  I understand her 
to be wanting to get either 1 or 2 extensions:  1 if the person logging in 
*is* a supervisor, and 2 if the person logging in* has* a supervisor (PLI's 
extension, + PLI's super's extension).

 

> If so:
>
> the_supervised = db(db.auth_user.Supervisor == 
> ParticularSupervisor.id)._select(db.auth_user.id)
> extensions_of_the_supervised = 
> db(db.Extension.Person.belongs(the_supervised)).select()
>
> This will give you the extensions of everyone that is supervised by this 
> person.  
>

Rough idea of what I think Carla wants:

auth.users = {("Joe", "5678", "no", "Julie"), ("Julie", "5432", "yes", "")}

stuff = db(db.auth.users.name == "Joe").select()
results = stuff.name + "has logged in at " + now() + " working at ext " + 
stuff.ext
if stuff.issuper == "no":
  morestuff = db(db.auth.users.name == stuff.supername).select()
  results = results + BR() + "Supervisor: " + morestuff.name + " at ext " + 
morestuff.ext
return results



and I think Carla is trying to do a join to get everything in 1 query.

/dps

 

-- 
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][OT] Workflow

2015-09-16 Thread António Ramos
I need a sample web2py app :)
How do i integrate it with dal records?
For example a simple expenses approval..
Em 16/09/2015 19:26, "Dave S"  escreveu:

>
>
> On Wednesday, September 16, 2015 at 4:01:19 AM UTC-7, Ramos wrote:
>>
>> My company and many others would buy a web workflow framework. for
>> example a Workflow as a service...
>>
>> We dont want blogs we want real enterprise tools.
>>
>
> What's missing from SpiffWorkflow?  The documentation looks fairly
> professional (at a quick glance).
> 
>
>
> Fysom is a finite state machine generator.  Workflow processes can be
> mapped to the transitions, I guess, and outputs to the states.  I'd have to
> think about how to set it up for meeting multiple requirements on the
> inputs; probably using substates to match the set of requirements; from the
> super state, that would look inputs casuing a transition to self until all
> inputs were present.  I haven't done that for workflow, but some device
> drivers had that sort of FSM within an FSM (device discovery, for instance).
> 
>
>
> On Tue, Sep 15, 2015 at 4:33 PM, Niphlod  wrote:
>>>

 [...]
 if you need general purpose unrelated to tasks, use SpiffWorkflow or
 fysom.



>>
>
> /dps
>
> --
> 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: XML pickle/unpickle

2015-09-16 Thread Maxim Hrustalev


> Why do you want comment it out anyway?
>

This: 

> The reason is that is allows storing variables that contain XML('.') 
> in sessions. That is useful to deal with flash messages that contain more 
> than just text. 


I want to store XML in session flash message, like Massimo stated, but in 
fact this code prevents to do it. If I try 
session.flash = XML('Hello world')
the output is "Hello world", and if I comment out the code above, 
the output is as desired "Hello *world*".

-- 
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: Initialize vars

2015-09-16 Thread Leonel Câmara
vars is web2py's Storage that is really just a python dictionary that 
allows you to use dot notation so your question is really a python one (not 
web2py).
https://docs.python.org/2/library/stdtypes.html#dict.clear 

-- 
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: We do not delete posts

2015-09-16 Thread Maxim Hrustalev
Thank you very much.

On Wednesday, September 16, 2015 at 4:52:44 PM UTC+3, Massimo Di Pierro 
wrote:
>
> Apologies. Either we did a mistake a mistake when moderating your previous 
> posts (click on wrong button) or google is acting up (has happened before). 
> I did whitelist you again this time. Finger crossed!
>
>
> On Wednesday, 16 September 2015 08:42:58 UTC-5, Maxim Hrustalev wrote:
>>
>> Dear moderators,
>>
>> How many posts do I need to post to be added to white list? Is it just 
>> bad luck or what?
>>
>> Thnx
>>
>> On Monday, July 20, 2015 at 11:08:57 AM UTC+3, Massimo Di Pierro wrote:
>>
>>> We never delete posts from users, unless the users ask (because they 
>>> accidentally post the server password, for example). Yet first posts are 
>>> moderated to avoid spam. Usually when a post is on hold for moderation it 
>>> is approved within 24 hours or less.
>>>
>>> There are some glitches in the process. 
>>> - Occasionally some posts have disappeared on their own. We attributed 
>>> this to a Google glitch. It has not happened recently. 
>>> - Some times Google requires moderation even for posts from people that 
>>> have been whitelisted. This is not our policy and we do not know why it 
>>> happens, but it does. 
>>> - Some posts have erroneously been flagged as spam by moderators. We can 
>>> fix this.
>>> - Some times it takes longer then 24 hrs for a post to be moderated, but 
>>> never more than 48 hrs.
>>> These problems are very very rare.
>>>
>>> If your first post does not show up, then it is moderated. Just wait. Do 
>>> not post 10 more copies of it. That just calls for trouble and more work 
>>> for all of us. If your post does not show up in 24 hours, email me 
>>> personally and I will take a look.
>>>
>>> We could use some more moderators, so feel free to volunteer by emailing 
>>> me.
>>>
>>> Fun fact: 90% of spam posts are job announcements about Java.
>>>
>>> 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] Re: sql query

2015-09-16 Thread Dave S


On Wednesday, September 16, 2015 at 5:41:22 AM UTC-7, Laurent Lc wrote:
>
> Thank you for your qick answer.
> Ok i understand.
> Yes it works if use:
>
> for row in dbRH(dbRH.test.login=="Laurent").select():
> firstname = row.firstname
>
>
> but the problem is that i would to use the var "auth.user.username" for my 
> request and i don't know how to do
>

maybe this?
for row in dbRH(dbRH.test.login == auth.user.username).select()

 
And I think the executesql() version would be:

query='SELECT * from test WHERE login=" + auth.user.username
firstname =dbRH.executesql(query,as_dict=True)



/dps



> Le mercredi 16 septembre 2015 13:26:16 UTC+2, Mirek Zvolský a écrit :
>>
>> I don't know what SQLField() means, I use Field() instead.
>>
>> The variable loginsession is defined at the python level. SQL level will 
>> nothing know about it.
>> So you run really the SQL command: "SELECT ... WHERE login=loginsession;".
>> Try same command in MySQL manager, it will not work because loginsession 
>> is unkown.
>>
>> Do you really need run raw SQL commands (with .executesql())?
>> Isn't better way use a DAL abstraction language like
>>   dbRH(dbRH.test.id>0).select()
>> or
>>   dbRH(dbRH.test.login=="Laurent").select()
>> ?
>>
>>
>>
>> Dne středa 16. září 2015 12:34:09 UTC+2 Laurent Lc napsal(a):
>>>
>>> Hi 
>>> could you explain me why it does not work :
>>> my file db.py (a part of file)
>>>
>>> loginsession = auth.user.username
>>> dbRH = DAL('mysql://xxx:xxx@localhost/RH', pool_size=0)
>>> dbRH.define_table('test',
>>> SQLField('login', type = 'string' , length = 20 ),
>>> SQLField('nom', type = 'string' , length = 20 ),
>>> SQLField('prenom', type = 'string' , length = 20 ),
>>> SQLField('groupe', type = 'string' , length = 15 ),
>>> SQLField('mail', type = 'string' , length = 50 ),
>>> migrate = False)
>>> query='SELECT * from test WHERE login=loginsession'
>>> firstname =dbRH.executesql(query,as_dict=True)
>>>
>>> If i replace the var loginsession by "toto", it works and the var 
>>> loginsession has a value ...
>>>
>>> Another question about DAL if i follow the doc :
>>> #q=dbRH.test.login==loginsession
>>> #s=db(q)
>>> #rows=s.select()
>>> #for row in rows:
>>> #prenom = row.prenom
>>>
>>> does not run too ...
>>>
>>>
>>> Thank you in advance 
>>> Regards,
>>>
>>>
>>>
>>>

-- 
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 it possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
would like to have two "requires" in DAL.  Does below effort make sense?

the IS_IN_DB part works by itself, but the lambda is a guess.  It crashes 
after attempt to add a record.

Field('organizationID','reference Organization', requires = [IS_IN_DB(db, 
'Organization.id', '%(organizationFullName)s',zero=T('choose one')), lambda 
id, row: db.Organization(organizationID).organizationPrimaryTypeID == 1]),

thanks

Alex Glaros

-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
the goal is to have the list populated by only records 
with organizationPrimaryTypeID == 1

but now that I look at it, it might only accept or reject, but not filter 
the options

-- 
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: web2py SPA(single page application)

2015-09-16 Thread Massimo Di Pierro
I had problems with vue.js Like chancing the triple delimiters did not work 
for me.

On Wednesday, 16 September 2015 09:37:06 UTC-5, Ramos wrote:
>
> My favourite is Vuejs
> learn from here
>
> http://vuejs.org/guide/
> https://laracasts.com/series/learning-vuejs
> you can go very crazy with it
>
>
> 2015-09-16 15:05 GMT+01:00 Márcio Almeida <
> marciolauriano.alme...@gmail.com>:
>
>> Thank you, I will study it.
>> If anyone has more information, please post.
>>
>> Em segunda-feira, 14 de setembro de 2015 22:14:53 UTC-3, Márcio Almeida 
>> escreveu:
>>>
>>> Hi, I'm trying to create a spa-like application to not reload it 
>>> whenever you change page, I tried example of web2pyslices but
>>> only charges the index page, the other I did not know how to load (
>>> http://www.web2pyslices.com/slice/show/2030/creating-a-single-page-app-with-web2py
>>> ).
>>> Has anyone had any experience with this or know how to evolve the 
>>> example of web2pyslices?
>>> Some solution in web2py?
>>> I think some will tell me about angularjs etc, okay with it gives, but 
>>> did not want to mix things up, native web2py does it have any way out?
>>>
>>> Thanks people.
>>>
>> -- 
>> 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][OT] Workflow

2015-09-16 Thread Dave S


On Wednesday, September 16, 2015 at 2:22:42 PM UTC-7, 黄祥 wrote:
>
> just an idea, why not put is_approved field as boolean in expense or 
> cash_out table and do the check if is_approved == True do something like 
> can print, email, process further in another transaction, etc. if 
> is_approve == False can't print, email, process further in another 
> transaction, etc
>
>
I expect that one of the requirements would be to make sure the person 
who's supposed to approve it knows that he has to take action.

/dps
 

-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
or is there anything like this that's valid?

Field('organizationID','reference Organization', requires = IS_IN_DB(db, db.
Organization(id).organizationPrimaryTypeID == 1, '%(organizationFullName)s',
zero=T('choose one'))), 


-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
So it seems the only alternatives are:

1. create a view in raw sql for that specific data base, or
2. create a query, and use that to populate dropdown list of choices. In 
this case, is it recommended to write the query in default.py vs db.py so 
that the database doesn't take uncessary hits?

thanks,

Alex

-- 
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: web2py SPA(single page application)

2015-09-16 Thread António Ramos
Massimo, can you explain what it "chancing the triple delimiters" ?

i used web2py with vuejs without a problem...


for example i import my app.js  in my view to kick vuejs

(function ($, Vue) {

$(document).ready(function () {
Vue.config.delimiters = ['(%', '%)'];

new Vue({
  el: '#demo',
  data: {
   var1:'aa'

  },
  filters:{
  first:function(value,stop){
  return value.slice(0,stop);
  }

  },
  methods:
  {
selectFormula:function(form){

  },
log: function(arg) {
console.log(arg);
},

},
ready:function(){

}
   });
  });
})($, Vue);

2015-09-16 22:20 GMT+01:00 Massimo Di Pierro :

> I had problems with vue.js Like chancing the triple delimiters did not
> work for me.
>
>
> On Wednesday, 16 September 2015 09:37:06 UTC-5, Ramos wrote:
>>
>> My favourite is Vuejs
>> learn from here
>>
>> http://vuejs.org/guide/
>> https://laracasts.com/series/learning-vuejs
>> you can go very crazy with it
>>
>>
>> 2015-09-16 15:05 GMT+01:00 Márcio Almeida <
>> marciolauriano.alme...@gmail.com>:
>>
>>> Thank you, I will study it.
>>> If anyone has more information, please post.
>>>
>>> Em segunda-feira, 14 de setembro de 2015 22:14:53 UTC-3, Márcio Almeida
>>> escreveu:

 Hi, I'm trying to create a spa-like application to not reload it
 whenever you change page, I tried example of web2pyslices but
 only charges the index page, the other I did not know how to load (
 http://www.web2pyslices.com/slice/show/2030/creating-a-single-page-app-with-web2py
 ).
 Has anyone had any experience with this or know how to evolve the
 example of web2pyslices?
 Some solution in web2py?
 I think some will tell me about angularjs etc, okay with it gives, but
 did not want to mix things up, native web2py does it have any way out?

 Thanks people.

>>> --
>>> 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.
>

-- 
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][OT] Workflow

2015-09-16 Thread 黄祥
just an idea, why not put is_approved field as boolean in expense or 
cash_out table and do the check if is_approved == True do something like 
can print, email, process further in another transaction, etc. if 
is_approve == False can't print, email, process further in another 
transaction, etc

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: Has anyone integrated user-driven multiprocessing?

2015-09-16 Thread Phillip
Are you saying that workers should be started before any tasks are queued 
(by an arbitrary number of users) which will be running for an arbitrary 
amount of time? 

If the answer is no

Here is the set up: There is a grid of files from which a user can generate 
'offspring' files in all possible combinations. Previous inquiry has 
led me to think the scheduler could be used for multiprocessing here 
(instead of the ostensibly problematic multiprocessing module). 
The queued tasks are derived from the python script that processes 
user-selected files, called in the controller when these file id's are 
passed via ajax.

Otherwise,

Is there a processing brick wall here? If, for instance, the app was on 
Google App Engine, could I simply start a large number of idle workers to 
handle potential spikes in user requests?


Thank you for the response 

 

 

-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
 'DAL' object has no attribute 
'(Organization' Version web2py™ Version 
2.12.2-stable+timestamp.2015.08.09.14.29.44 Python Python 2.7.9: 
C:\alex\alt_web2py\web2py\web2py.exe (prefix: C:\Python27) Traceback 

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

Traceback (most recent call last):
  File "C:\alex\alt_web2py\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "C:/alex/alt_web2py/web2py/applications/ES1/controllers/appadmin.py" 
, line 
464, in 
  File "C:\alex\alt_web2py\web2py\gluon\globals.py", line 412, in 
self._caller = lambda f: f()
  File "C:/alex/alt_web2py/web2py/applications/ES1/controllers/appadmin.py" 
, line 
126, in insert
form = SQLFORM(db[table], ignore_rw=ignore_rw)
  File "C:\alex\alt_web2py\web2py\gluon\sqlhtml.py", line 1259, in __init__
inp = self.widgets.options.widget(field, default)
  File "C:\alex\alt_web2py\web2py\gluon\sqlhtml.py", line 313, in widget
options = requires[0].options()
  File "C:\alex\alt_web2py\web2py\gluon\validators.py", line 586, in options
self.build_set()
  File "C:\alex\alt_web2py\web2py\gluon\validators.py", line 557, in build_set
table = self.dbset.db[self.ktable]
  File "C:\alex\alt_web2py\web2py\gluon\packages\dal\pydal\base.py", line 900, 
in __getitem__
return self.__getattr__(str(key))
  File "C:\alex\alt_web2py\web2py\gluon\packages\dal\pydal\base.py", line 907, 
in __getattr__
return ogetattr(self, key)
AttributeError: 'DAL' object has no attribute '(Organization'

-- 
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][OT] Workflow

2015-09-16 Thread Richard Vézina
I see SpiffWorkflow get back to work... There is a couple commit 2 months
ago... I thought when I look to it that it was abandoned since there were
no activity since 2 years...

Richard

On Wed, Sep 16, 2015 at 8:00 PM, 黄祥  wrote:

> yes, you are right, i think, you can combine it with query in let say
> Manager page to check total expense which is_approved == False or use
> oncreate function (sqlform.grid) after the expense is created, send an
> email to user who have approval privilege (Manager), and linked it into
> expense function, so that Manager can approve or reject it.
>
> 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.
>

-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
okay, this looks promising. It's exactly what I want:

Field('organizationID','reference Organization', requires = IS_IN_DB(db, db.
Organization.organizationPrimaryTypeID == 1)), 

it raises this error

 'DAL' object has no attribute 
'(Organization'

but there is no string with parentheses like this in the whole db.py: 
 (Organization 


-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
 Code listing 

902.
903.
904.
905.
906.
907.

908.
909.
910.
911.

def __getattr__(self, key):
if ogetattr(self,'_lazy_tables') and \
key in ogetattr(self,'_LAZY_TABLES'):
tablename, fields, args = self._LAZY_TABLES.pop(key)
return self.lazy_define_table(tablename,*fields,**args)
return ogetattr(self, key)


def __setitem__(self, key, value):
osetattr(self, str(key), value)

Variables

-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
okay, I get similar error no matter what table or fields used.

Is this syntax wrong?

Field('organizationID','reference Organization', requires = IS_IN_DB(db, db.
Organization.organizationPrimaryTypeID == 1)), 


-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Leonel Câmara

Did you define the Organization table before this one?



-- 
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 possible to have this type of multiple requires in db.py?

2015-09-16 Thread Alex Glaros
yes, it's before.  

-- 
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][OT] Workflow

2015-09-16 Thread 黄祥
yes, you are right, i think, you can combine it with query in let say 
Manager page to check total expense which is_approved == False or use 
oncreate function (sqlform.grid) after the expense is created, send an 
email to user who have approval privilege (Manager), and linked it into 
expense function, so that Manager can approve or reject it.

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.


Re: [web2py] How to write documentation for REST API?

2015-09-16 Thread Richard Vézina
Consider using other theme, I like abalaster (I think it the one used by
Flask, minimalist) : https://pypi.python.org/pypi/alabaster

I didn't see it but there is a bootstrap one too :
https://pypi.python.org/pypi/sphinx-bootstrap-theme/

Your project look nice... A lot of work...

:)

Richard

On Tue, Sep 15, 2015 at 4:11 PM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> In the end I used sphinx with this extension:
>
> http://pythonhosted.org/sphinxcontrib-httpdomain
>
>
>
> 2015-09-15 3:56 GMT+02:00 Richard Vézina :
>
>> I like the way it's done here : https://open.fda.gov/api/reference
>>
>> I had saw many API doc that were looking the same (just can found back a
>> couple of example). I thought at first that it was made using sphinx but
>> can't found any trace of it in the souce of the page or on the github of
>> the open fda projects... There is a mention of pygments on the github, so
>> maybe it only using pygments for syntax higligths...
>>
>> It may be less heavy then sphinx to put in place...
>>
>> Richard
>>
>> On Mon, Sep 14, 2015 at 3:57 AM, Michele Comitini <
>> michele.comit...@gmail.com> wrote:
>>
>>> What is a good way to document a small REST API (@request.restful)?
>>> sphinx?
>>>
>>> Suggestions welcome!
>>>
>>> mic
>>>
>>> --
>>> 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.
>>
>
> --
> 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: Why do i have to submit the form twice in order to work?

2015-09-16 Thread Alfonso Serra
What i was trying is easy, no ajax or js involved.
Something like this:


Each field is contained within an input and each row withtin a form with 
several kinds of submits (update, delete or insert)


My doubts were:

Because i need that many forms as records i was wondering if i need to do 
the same at the controller, create as many SQLFORMS as records. With what 
you posted It looks like this wont be necessary. 


Im not sure what the controller should look like but Ill definetly try your 
example.


Thanks






-- 
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: Why do i have to submit the form twice in order to work?

2015-09-16 Thread Annet
Hi Alfonso,

Seeing a picture of what you're trying to build, I wonder why you're not 
using
SQLFORM.smartgrid as described in the book:

http://web2py.com/books/default/chapter/29/03/overview#Adding-grids

You can modify the grid in all kinds of ways:

http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-signature


Kind regards,

Annet

-- 
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: SQL select with a var

2015-09-16 Thread Laurent Lc
you were right, it was not exactly the same code.
Now i put the code in db.py, and i use the request to set default values in 
a form. Is it a good way ?

Le mercredi 16 septembre 2015 16:48:19 UTC+2, Anthony a écrit :
>
> On Wednesday, September 16, 2015 at 10:33:39 AM UTC-4, Laurent Lc wrote:
>>
>> like this :
>> myvar="toto"
>> for row in dbRH(dbRH.test.login==myvar).select():
>> firstname = row.firstname
>>
>> the sql request doesn't work beacause myvar does not exist in sql but in 
>> python. so i don't know how to do
>>
>
> Yes, myvar is a Python variable, but then again, it is being used in 
> Python code, so no problem there. The DAL will convert that to the 
> appropriate SQL statement. Are you sure that is your *exact* code? How 
> are you determining whether it "works"? I suspect you have a problem 
> elsewhere.
>
> Anthony
>

-- 
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: Self-referencing tables and queries

2015-09-16 Thread Leonel Câmara
> I think in this case they won't be strings since I read the numbers from 
a XML and they don't have the '+' character

So what? You should future proof the app. Some day there might be 
extensions in India or something.

> Not all the supervisors.I want to get the extensions of a particular 
supervisor

Do you mean the extensions of the persons he supervises? If so:

the_supervised = db(db.auth_user.Supervisor == 
ParticularSupervisor.id)._select(db.auth_user.id)
extensions_of_the_supervised = 
db(db.Extension.Person.belongs(the_supervised)).select()

This will give you the extensions of everyone that is supervised by this 
person.  


-- 
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 - Front-end performance optimization tutorial

2015-09-16 Thread Anthony

>
> @Anthony: when I said "private" I meant a Cloudflare account, so #2
>

Hmm, then I wonder about your claims of "private" CDNs being more reliable. 
Is it the case that the cdnjs CDN being run by Cloudflare is less reliable 
than a regular Cloudflare account?

Basically, I'm not disputing the fact that web2py is built with a lot of 
> interesting features (batteries included).
> What I do regret is the lack of settings that would allow you to customize 
> / overwrite / extend these features when you come to outscale them.
>

What specifically would you like to customize/overwrite/extend? Are you 
saying that web2py is stopping you from doing something, or just that it 
lacks some more sophisticated built-in features that you would like? 

Anthony

-- 
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: Initialize vars

2015-09-16 Thread lenin . martinez
Omg thanks problem solved. Can you give me more documentation about that.

El miércoles, 16 de septiembre de 2015, 12:38:07 (UTC-4:30), Anthony 
escribió:
>
> request.vars is already initialized to a gluon.storage.Storage object. If 
> it is not empty but you want to empty it, you can do:
>
> request.vars.clear()
>
> Anthony
>
> On Wednesday, September 16, 2015 at 11:54:38 AM UTC-4, 
> lenin.m...@metamaxzone.com  wrote:
>>
>> Hello i need initialize 
>>
>>
>> *request.vars, or request.post_vars etc... im alredy tried the following 
>> codes*
>>
>>- *request.vars = None*
>>- *request.vars = Nan*
>>- *request.vars = {}*
>>- *request.vars = ''*
>>
>> *And nothing yet. thank's*
>>
>

-- 
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.