Re: [web2py] Re: Direct editing inside a grid

2014-07-17 Thread Manuele Pesenti
Il 17/07/14 18:18, Serge Bourgeois ha scritto:
> but, I got a message saying that I couldn't change the objects already
> existing ...
look for a validator... in case you are using IS_NOT_IN_DB it happens
that when you're not updateing a value in a field with this validator
but other, because of the whole record will be submitted for update, the
value not modified is considered in the query because already in db and
that cause the error.
A solution coud be to rewrithe the query passed to the validator on the
fly when you are in edit mode...

Hope it could help

Cheers

 M.

-- 
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: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish

  Bench


They get added through javascript from the first select element.

On Thursday, July 17, 2014 10:14:17 PM UTC-4, Anthony wrote:
>
> The first select has no name, and the second one has no 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.


[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Anthony
The first select has no name, and the second one has no 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.


[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish

  
   

  Title: 
  
  
   
   
 
  How long 
is this workout?: 
 
 
 
   
   
 
   Add Exercise 
+
 


  

  Bench
  Kettle Bell 
Breathing
  Squat
  Zercher Squat

  


   
   
   
 
   - Remove 
Exercise
 
   
   
  
  

  


  
  


  


On Thursday, July 17, 2014 9:17:55 PM UTC-4, Anthony wrote:
>
> What does the final form HTML end up looking like in the web page?
>
> On Thursday, July 17, 2014 8:39:26 PM UTC-4, Frank Buibish wrote:
>>
>> It does not just says none
>>
>

-- 
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: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Anthony
What does the final form HTML end up looking like in the web page?

On Thursday, July 17, 2014 8:39:26 PM UTC-4, Frank Buibish wrote:
>
> It does not just says none
>

-- 
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] problem with request_reset_password routes on server

2014-07-17 Thread Júlia Rizza
Hello,

I have a controller called 'painel.py' and the following config in my 
*db.py* file:
## configure auth policy
auth.settings.mailer=mail
auth.settings.controller = 'painel'
auth.settings.actions_disabled.append('register')
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.allow_basic_login = False
auth.settings.reset_password_requires_verification = True
auth.settings.login_url = URL('painel', 'index')
auth.settings.login_next = URL('painel', 'dashboard')
auth.settings.logged_url = URL('painel', 'dashboard')
auth.settings.request_reset_password_next = URL('painel', 'index')
auth.settings.reset_password_next = URL('painel', 'index')
auth.settings.logout_next=URL('painel', 'index')
auth.settings.profile_next = URL('painel', 'dashboard')
auth.settings.retrieve_username_next = URL('painel', 'dashboard')
auth.settings.retrieve_password_next = URL('painel', 'dashboard')
auth.settings.change_password_next = URL('painel', 'dashboard')
auth.settings.on_failed_authentication = URL('painel', 'index')

I defined *painel.py* as auth controller so the login url when it is an 
invalid login won't be crashing, but the user function is still on the 
*default.py* controller. But now when I access the 'request_reset_password' 
page and try to enter my username and submit the form, it works normally on 
localhost but not on server (Apache on Ubuntu). The routes when submiting 
the form are '/user/request_reset_password' on localhost, but '/myapp/
*painel*/user/request_reset_password' (wrong controller) on server. Is 
there a better way to fix this?

*routes.py*



*BASE = ''routes_in = ((BASE + '/', BASE + '/myapp/painel/index'),
(BASE + '/user/$anything', BASE + '/myapp/default/user/$anything'),
(BASE + '/download/$anything', BASE + 
'/myapp/default/download/$anything'),(BASE + '/call/$anything', BASE + 
'/myapp/default/call$anything'),(BASE + '/data/$anything', BASE + 
'/myapp/default/data/$anything'),(BASE + '/myapp/static/$anything', 
BASE + '/myapp/static/$anything'),(BASE + '/myapp/appadmin', BASE + 
'/myapp/appadmin'),(BASE + '/myapp/appadmin/$anything', BASE + 
'/myapp/appadmin/$anything'),(BASE + '/index', BASE + 
'/myapp/painel/index'),(BASE + '/start', BASE + 
'/myapp/painel/start'),(BASE + '/dashboard', BASE + 
'/myapp/painel/dashboard'),(BASE + '/monitor', BASE + 
'/myapp/painel/monitor'),(BASE + '/accept/$anything', BASE + 
'/myapp/painel/accept/$anything'),(BASE + '/invite', BASE + 
'/myapp/painel/invite'),(BASE + '/invite/$anything', BASE + 
'/myapp/painel/invite/$anything'),(BASE + '/delete/$anything', BASE + 
'/myapp/painel/delete/$anything'),(BASE + '/$anything', BASE + 
'/myapp/painel/board/$anything'),)routes_out = [(x, y) for (y, x) in 
routes_in]*

-- 
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: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish
It does not just says none

-- 
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: DAL - compare datetime field to a date

2014-07-17 Thread Jim S
Yes.  Sorry, that was a typo in my description.  I was using request.now.

The problem is that gives a datetime so the datetime would not be equal.

What I've done now is this:

start = parse('%s 00:00:00' % (request.now.strftime('%Y-%m-%d')))
end = parse('%s 23:59:59' % (request.now.strftime('%Y-%m-%d')))
open_workorders = db((db.workorder.siteId.belongs(sites)) &
 (db.workorder.completed==None) &
 (db.workorder.needed>=start) &

 
(db.workorder.needed<=end)).select(left=db.site.on(db.workorder.siteId==db.site.siteId),

orderby=db.site.siteNumber)

Not ideal, but it works.  Just seems messy.  parse is coming from the 
python-dateutil package.

-Jim

On Thursday, July 17, 2014 4:42:47 PM UTC-5, 黄祥 wrote:
>
> had you already tried request.now?
> workorders = db(db.workorder.needed == request.now).select()
>
> ref:
> http://web2py.com/books/default/chapter/29/04/the-core#request
>
> 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: Embedding an html string in a component

2014-07-17 Thread Anthony
The image source is shown as src="cid:image001.png@01CFA1BC.429B6EC0". 
You'll need to save the image separately and service it as a static file, 
changing the src attribute accordingly.

Anthony

On Thursday, July 17, 2014 5:24:16 PM UTC-4, Jim S wrote:
>
> Thanks Anthony, that worked.  Now I just have to figure out how to get the 
> images to display as well.
>
> -Jim
>
> On Thursday, July 17, 2014 3:16:18 PM UTC-5, Jim S wrote:
>>
>> Thanks Anthony, I'll give that a try.
>>
>> -Jim
>>
>> On Thursday, July 17, 2014 3:14:59 PM UTC-5, Anthony wrote:
>>>
>>> You can extract just the DIV and return it as the HTML of the component. 
>>> As for the CSS, technically that should probably go in the head element of 
>>> the parent page, but I think most browsers will still recognize it if you 
>>> put it elsewhere (e.g., within the returned component HTML).
>>>
>>> Anthony
>>>
>>> On Thursday, July 17, 2014 3:09:30 PM UTC-4, Jim S wrote:

 I don't think my problem is really web2py related but was hoping 
 someone here might have done this already.

 The attached file is the html representation of an email.

 I want to embed and display that file within my page.  Actually it is a 
 load'd component. I don't want it displayed verbatim, I want it to render 
 the page respecting the html and css.  I'm having a brain-block and can't 
 figure out how to do it.  

 Has anyone else ever done anything like this?  Seems to me like this 
 should be really easy, but I'm really not making any headway on it.

 -Jim

>>>

-- 
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: DAL - compare datetime field to a date

2014-07-17 Thread 黄祥
had you already tried request.now?
workorders = db(db.workorder.needed == request.now).select()

ref:
http://web2py.com/books/default/chapter/29/04/the-core#request

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] DAL - compare datetime field to a date

2014-07-17 Thread Jim S
I have a field setup as:

Field('needed','datetime')

In my query I want to get a list of all workorders where the needed field 
occurs today.

So, something like this:

workorders = db(db.workorder.needed==request.today).select()

I know this doesn't work but this it shows what I'm looking for.

-Jim

-- 
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: Embedding an html string in a component

2014-07-17 Thread Jim S
Thanks Anthony, that worked.  Now I just have to figure out how to get the 
images to display as well.

-Jim

On Thursday, July 17, 2014 3:16:18 PM UTC-5, Jim S wrote:
>
> Thanks Anthony, I'll give that a try.
>
> -Jim
>
> On Thursday, July 17, 2014 3:14:59 PM UTC-5, Anthony wrote:
>>
>> You can extract just the DIV and return it as the HTML of the component. 
>> As for the CSS, technically that should probably go in the head element of 
>> the parent page, but I think most browsers will still recognize it if you 
>> put it elsewhere (e.g., within the returned component HTML).
>>
>> Anthony
>>
>> On Thursday, July 17, 2014 3:09:30 PM UTC-4, Jim S wrote:
>>>
>>> I don't think my problem is really web2py related but was hoping someone 
>>> here might have done this already.
>>>
>>> The attached file is the html representation of an email.
>>>
>>> I want to embed and display that file within my page.  Actually it is a 
>>> load'd component. I don't want it displayed verbatim, I want it to render 
>>> the page respecting the html and css.  I'm having a brain-block and can't 
>>> figure out how to do it.  
>>>
>>> Has anyone else ever done anything like this?  Seems to me like this 
>>> should be really easy, but I'm really not making any headway on it.
>>>
>>> -Jim
>>>
>>

-- 
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: can web2py expose coffee files to allow source maps ?

2014-07-17 Thread António Ramos
@Massimo, any news about exposing source maps so i can debug coffeescript
files in the browser?

Thanks


2014-07-12 13:17 GMT+01:00 António Ramos :

> The link has a transcription to text of the video comments
> Em 12/07/2014 08:49, "Massimo Di Pierro" 
> escreveu:
>
>  What does the video say? Can you summarize it? I have limited bandwidth
>> today.
>>
>> On Friday, 11 July 2014 17:22:24 UTC-5, Ramos wrote:
>>>
>>> Can this help to use coffeescript instead of javascript ?
>>>
>>> http://tarantsov.com/WorkflowThu/source-maps-with-
>>> coffeescript-and-uglify-js/
>>>
>>> web2py does not expose coffeefiles as the video says.. does it?
>>>
>>> Regards
>>>
>>> António
>>>
>>  --
>> 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: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Cliff Kachinske
I've worked around it, so not a concern at this very moment.

If I ever get out of crunch time I"ll look into it.

Cliff Kachinske

On Thursday, July 17, 2014 11:59:57 AM UTC-4, Anthony wrote:
>
> Here's the framework code:
>
> status = self._traverse(status, hideerror) 
> status = self.assert_status(status, request_vars)
> if onvalidation:
>
> ._traverse is where individual field validators are run, which happens 
> before onvalidation. We'll probably have to see some code to figure out 
> what's going on here.
>
> Anthony
>
> On Thursday, July 17, 2014 7:01:34 AM UTC-4, Cliff Kachinske wrote:
>>
>> It appears not to. 
>>
>> If I put a print statement in there it never executes. If I tell it to 
>> return the value and some arbitrary string it doesn't happen.
>>
>> On Thursday, July 17, 2014 6:56:41 AM UTC-4, Leonel Câmara wrote:
>>>
>>> Do you mean onvalidation? It's supposed to run your validators first.
>>>
>>>

-- 
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: Weird bug using a computed field and then having an update using expressions

2014-07-17 Thread Anthony
A computed field must be given actual values with which to compute, as the 
final value is computed by web2py and then inserted into the DB. Your 
second example uses expressions to express the values to be inserted in the 
score and created_on fields. However, these expressions will ultimately be 
evaluated and converted to values by the database itself, so they are never 
available to web2py for calculation of the computed field. Something like 
your first approach is necessary if you want to update a computed field.

Anthony

On Thursday, July 17, 2014 2:58:44 PM UTC-4, Leonel Câmara wrote:
>
> If I do this my computed field (that depends on score and created on) is 
> updated correctly:
>
> def some_other_table_after_insert(f, id):
> record = db.table_with_computed_field[f['ref']]
> new_score = record.score + f['score']
> record.update_record(score=new_score, created_on=record.created_on)
>
> While if I do this, it doesn't work, and I can see that my compute 
> function is getting Expressions where it should be getting values:
>
> def some_other_table_after_insert(f, id):
> db(db.table_with_computed_field.id == 
> f['ref']).update(score=db.table_with_computed_field.score + f['score'], 
> created_on=db.table_with_computed_field.created_on)
>
> Isn't this a bug? Shouldn't the Expressions have been calculated before 
> getting to the compute function?
>
> I only noticed because my compute was silently not doing anything and I 
> had to use the traceback module to find what was going on:
>
> AttributeError: 'Expression' object has no attribute 'days'
>
> Clearly caused by the created_on being an Expression instead of the 
> datetime it should be.
>

-- 
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: Embedding an html string in a component

2014-07-17 Thread Jim S
Thanks Anthony, I'll give that a try.

-Jim

On Thursday, July 17, 2014 3:14:59 PM UTC-5, Anthony wrote:
>
> You can extract just the DIV and return it as the HTML of the component. 
> As for the CSS, technically that should probably go in the head element of 
> the parent page, but I think most browsers will still recognize it if you 
> put it elsewhere (e.g., within the returned component HTML).
>
> Anthony
>
> On Thursday, July 17, 2014 3:09:30 PM UTC-4, Jim S wrote:
>>
>> I don't think my problem is really web2py related but was hoping someone 
>> here might have done this already.
>>
>> The attached file is the html representation of an email.
>>
>> I want to embed and display that file within my page.  Actually it is a 
>> load'd component. I don't want it displayed verbatim, I want it to render 
>> the page respecting the html and css.  I'm having a brain-block and can't 
>> figure out how to do it.  
>>
>> Has anyone else ever done anything like this?  Seems to me like this 
>> should be really easy, but I'm really not making any headway on it.
>>
>> -Jim
>>
>

-- 
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: Embedding an html string in a component

2014-07-17 Thread Anthony
You can extract just the DIV and return it as the HTML of the component. As 
for the CSS, technically that should probably go in the head element of the 
parent page, but I think most browsers will still recognize it if you put 
it elsewhere (e.g., within the returned component HTML).

Anthony

On Thursday, July 17, 2014 3:09:30 PM UTC-4, Jim S wrote:
>
> I don't think my problem is really web2py related but was hoping someone 
> here might have done this already.
>
> The attached file is the html representation of an email.
>
> I want to embed and display that file within my page.  Actually it is a 
> load'd component. I don't want it displayed verbatim, I want it to render 
> the page respecting the html and css.  I'm having a brain-block and can't 
> figure out how to do it.  
>
> Has anyone else ever done anything like this?  Seems to me like this 
> should be really easy, but I'm really not making any headway on it.
>
> -Jim
>

-- 
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: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Anthony
Is the value available in request.post_vars.selections?

On Thursday, July 17, 2014 3:37:38 PM UTC-4, Frank Buibish wrote:
>
> So I'm trying to build a multiple select box where i move things from a 
> select box on the left and put them on the right.  I have the values moving 
> correctly through javascript but when i submit the form it doesn't pick up 
> the value in the form.vars.
>  forms = dict()
> 
> forms[0] = SQLFORM(db.stuff, submit_button='Create')
> forms[0].element(_type='submit')['_class']='btn'
> forms[0][0].insert(-1, TR(A("Add", \
> _id="add", \
> _class="btn btn-default btd-md" ), 
> _id="buttons"))
> forms[0][0].insert(-1, TR(sbox, SELECT(_id="selected", _name="selections", 
> _multiple=""),**sbox_attributes))
> forms[0][0].insert(-1, TR(A("- Remove", \
> _id="remove", \
> _class="btn btn-default btd-md" ) 
> ,_id="buttons"))
>
> I add the button in a TR then the two SELECT boxes, sbox is a predefined 
> SELECT box with prepopulated with options.  How do I get the form to submit 
> the the values of the select box with name="selections"?  Do i need to use 
> a custom form? just using the plain FORM tags?
>
> Also as a side note, so on this page i have multiple forms, but could 
> potentially be hundreds of forms, hence the dictionary of forms.  Is it 
> better to send all the forms at once when the page is loaded? or should I 
> only send the id's of the records and then when clicked send the forms?
>

-- 
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: Direct editing inside a grid

2014-07-17 Thread Anthony
I don't have time to look into it, but seeing some code and a traceback 
might help.

Anthony

On Thursday, July 17, 2014 12:18:39 PM UTC-4, Serge Bourgeois wrote:
>
> Thanks Antony!. Do you know if there is any plan to develop such a 
> feature? If yes, do you have any idea of availability ? 
>
> Still a third question: I tried the idea proposed here : 
>
>
> http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript
>
> but, I got a message saying that I couldn't change the objects already 
> existing ... (I guess the name of the fields, even with migrate == False). 
>
> Maybe you have any good idea to turn around this issue?
>
> Serge
>  
>
> Le jeudi 17 juillet 2014 17:21:05 UTC+2, Anthony a écrit :
>>
>> This is not available out of the box, though it would be nice.
>>
>> Anthony
>>
>> On Thursday, July 17, 2014 10:25:20 AM UTC-4, Serge Bourgeois wrote:
>>>
>>> Hello,
>>>
>>> In order to simplify the user interface of basic controller functions, I 
>>> want to offer direct editing in SQLFORM.smartgrid, using the same widgets 
>>> (string, options, uploads, ...) than those available in create or edit. 
>>>
>>> Maybe, I missed the point in the doc?
>>>
>>> Thank you for any advice.
>>>
>>> Serge
>>>
>>>

-- 
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] SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish
So I'm trying to build a multiple select box where i move things from a 
select box on the left and put them on the right.  I have the values moving 
correctly through javascript but when i submit the form it doesn't pick up 
the value in the form.vars.
 forms = dict()

forms[0] = SQLFORM(db.stuff, submit_button='Create')
forms[0].element(_type='submit')['_class']='btn'
forms[0][0].insert(-1, TR(A("Add", \
_id="add", \
_class="btn btn-default btd-md" ), 
_id="buttons"))
forms[0][0].insert(-1, TR(sbox, SELECT(_id="selected", _name="selections", 
_multiple=""),**sbox_attributes))
forms[0][0].insert(-1, TR(A("- Remove", \
_id="remove", \
_class="btn btn-default btd-md" ) 
,_id="buttons"))

I add the button in a TR then the two SELECT boxes, sbox is a predefined 
SELECT box with prepopulated with options.  How do I get the form to submit 
the the values of the select box with name="selections"?  Do i need to use 
a custom form? just using the plain FORM tags?

Also as a side note, so on this page i have multiple forms, but could 
potentially be hundreds of forms, hence the dictionary of forms.  Is it 
better to send all the forms at once when the page is loaded? or should I 
only send the id's of the records and then when clicked send the forms?

-- 
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] Embedding an html string in a component

2014-07-17 Thread Jim S
I don't think my problem is really web2py related but was hoping someone 
here might have done this already.

The attached file is the html representation of an email.

I want to embed and display that file within my page.  Actually it is a 
load'd component. I don't want it displayed verbatim, I want it to render 
the page respecting the html and css.  I'm having a brain-block and can't 
figure out how to do it.  

Has anyone else ever done anything like this?  Seems to me like this should 
be really easy, but I'm really not making any headway on it.

-Jim

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




This is a test



 





 


 

Jim Steil
VP of Information Technology
Quality Liquid Feeds, Inc.
999.999. x857 office
999.999. cell

 





[web2py] Weird bug using a computed field and then having an update using expressions

2014-07-17 Thread Leonel Câmara
If I do this my computed field (that depends on score and created on) is 
updated correctly:

def some_other_table_after_insert(f, id):
record = db.table_with_computed_field[f['ref']]
new_score = record.score + f['score']
record.update_record(score=new_score, created_on=record.created_on)

While if I do this, it doesn't work, and I can see that my compute function 
is getting Expressions where it should be getting values:

def some_other_table_after_insert(f, id):
db(db.table_with_computed_field.id == 
f['ref']).update(score=db.table_with_computed_field.score + f['score'], 
created_on=db.table_with_computed_field.created_on)

Isn't this a bug? Shouldn't the Expressions have been calculated before 
getting to the compute function?

I only noticed because my compute was silently not doing anything and I had 
to use the traceback module to find what was going on:

AttributeError: 'Expression' object has no attribute 'days'

Clearly caused by the created_on being an Expression instead of the 
datetime it should be.

-- 
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: sessions2trash.py and memory usage

2014-07-17 Thread Annet
@Simone,

Thanks for your reply and explanation of cron and cleaning up sessions.
 

> PS: you definitely DO NOT want to schedule apache on cron
>

That's what Webfaction's install script for Web2py does by default, also 
they keep
telling me:

But note that cron jobs are better for such periodic tasks rather than 
having a 
long-running process which consumes memory unnecessary.

@Jose,

Thanks for your reply, in combination with Simone's explanation I 
understand the
workings, I'll give it a try.

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: Direct editing inside a grid

2014-07-17 Thread Serge Bourgeois
Thanks Antony!. Do you know if there is any plan to develop such a feature? 
If yes, do you have any idea of availability ? 

Still a third question: I tried the idea proposed here : 

http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript

but, I got a message saying that I couldn't change the objects already 
existing ... (I guess the name of the fields, even with migrate == False). 

Maybe you have any good idea to turn around this issue?

Serge
 

Le jeudi 17 juillet 2014 17:21:05 UTC+2, Anthony a écrit :
>
> This is not available out of the box, though it would be nice.
>
> Anthony
>
> On Thursday, July 17, 2014 10:25:20 AM UTC-4, Serge Bourgeois wrote:
>>
>> Hello,
>>
>> In order to simplify the user interface of basic controller functions, I 
>> want to offer direct editing in SQLFORM.smartgrid, using the same widgets 
>> (string, options, uploads, ...) than those available in create or edit. 
>>
>> Maybe, I missed the point in the doc?
>>
>> Thank you for any advice.
>>
>> Serge
>>
>>

-- 
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: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Anthony
Here's the framework code:

status = self._traverse(status, hideerror) 
status = self.assert_status(status, request_vars)
if onvalidation:

._traverse is where individual field validators are run, which happens 
before onvalidation. We'll probably have to see some code to figure out 
what's going on here.

Anthony

On Thursday, July 17, 2014 7:01:34 AM UTC-4, Cliff Kachinske wrote:
>
> It appears not to. 
>
> If I put a print statement in there it never executes. If I tell it to 
> return the value and some arbitrary string it doesn't happen.
>
> On Thursday, July 17, 2014 6:56:41 AM UTC-4, Leonel Câmara wrote:
>>
>> Do you mean onvalidation? It's supposed to run your validators first.
>>
>>

-- 
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: Compiling web2py application to run as a native windows app

2014-07-17 Thread Anthony
Check out 
http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries.

Python modules can go in the site-packages directory (if shared across 
apps) or in the application's /modules folder.

Anthony

On Wednesday, July 16, 2014 11:51:36 AM UTC-4, Latif Masud wrote:
>
> I have developed a web2py application that I want to run as a native 
> windows app. Meaning when they click an icon, it launches a browser and 
> runs the application. I was wondering if there is instructions somewhere on 
> how to do this. Also, I have two local files that I call into my app. Right 
> now, I am appending their paths to the sys.path variable, but I would like 
> to package them with the application. Is there a way I can do that?
>

-- 
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: Possible SQLCustomType bug with booleans

2014-07-17 Thread Anthony
Can't you just use the "represent" attribute for the custom display (and 
possibly a custom widget if you need special input as well)? What's wrong 
with your current code?

Anthony

On Thursday, July 17, 2014 9:29:00 AM UTC-4, Eric wrote:
>
> Hi There,
>
> Today I needed to use a SQLCustomType to convert a boolean to a string (in 
> view mode) and the other way around when storing it.
>
> I used this customtype:
>
> bool_to_text = SQLCustomType(
> type='string',
> native='boolean',
> encoder=lambda value: SQLFormFilters.store_text_as_boolean(value),
> decoder=lambda value: SQLFormFilters.view_boolean_as_text(value)
> )
>
> And this functions in the class
>
> @staticmethod
> def store_text_as_boolean(value):
> if value == 'true':
> return 'T'
> else:
> return 'F'
>
> @staticmethod
> def view_boolean_as_text(value):
> if value == 'T':
> return 'true'
> else:
> return 'false'
>
> I needed to use this check:
> value == 'T'
>
> because it looks like the DAL is always giving back a string in this 
> specific situation.
>
> When I use:
> value == True
>
> Web2py crashes with this error: 
>
> AttributeError: 'bool' object has no attribute 'replace'
> 
>
> Traceback (most recent call last):
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/restricted.py", line 220, 
> in restricted
> exec ccode in environment
>   File 
> "/home/eric/Projects/Web2Py/BricksSis/applications/portal/controllers/medication_templates.py",
>  line 147, in 
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/globals.py", line 385, in 
> 
> self._caller = lambda f: f()
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/tools.py", line 3287, in f
> return action(*a, **b)
>   File 
> "/home/eric/Projects/Web2Py/BricksSis/applications/portal/controllers/medication_templates.py",
>  line 71, in edit
> if form.process().accepted:
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/html.py", line 2282, in 
> process
> self.validate(**kwargs)
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/html.py", line 2219, in 
> validate
> if self.accepts(**kwargs):
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/sqlhtml.py", line 1590, in 
> accepts
> self.id_field_name]).update(**fields)
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 10549, in 
> update
> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1612, in 
> update
> sql = self._update(tablename, query, fields)
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1607, in 
> _update
> for (field, value) in fields])
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1552, in 
> expand
> return str(self.represent(expression,field_type))
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1978, in 
> represent
> return self.adapt(value)
>   File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 775, in adapt
> return "'%s'" % obj.replace("'", "''")
> AttributeError: 'bool' object has no attribute 'replace'
>
>
> Oh... I'm using SQLForms in the controller, the view contains a custom 
> form, I'm printing the field like this:
>
> {{=form.custom.widget.is_specialite}}
>
>
>

-- 
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: Direct editing inside a grid

2014-07-17 Thread Anthony
This is not available out of the box, though it would be nice.

Anthony

On Thursday, July 17, 2014 10:25:20 AM UTC-4, Serge Bourgeois wrote:
>
> Hello,
>
> In order to simplify the user interface of basic controller functions, I 
> want to offer direct editing in SQLFORM.smartgrid, using the same widgets 
> (string, options, uploads, ...) than those available in create or edit. 
>
> Maybe, I missed the point in the doc?
>
> Thank you for any advice.
>
> Serge
>
>

-- 
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] Direct editing inside a grid

2014-07-17 Thread Serge Bourgeois
Hello,

In order to simplify the user interface of basic controller functions, I 
want to offer direct editing in SQLFORM.smartgrid, using the same widgets 
(string, options, uploads, ...) than those available in create or edit. 

Maybe, I missed the point in the doc?

Thank you for any advice.

Serge

-- 
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] Relative URLs in development absolute URLs in production

2014-07-17 Thread Richard Vézina
I do that for DB connection :

try:
if request.env.http_host.split(':')[1] == '8005':
raise error  # To use shell in prod/staging environnement
elif request.env.http_host.split(':')[1] != '':
db = DAL('postgres://richard:password@127.0.0.1:5432/db',
 migrate_enabled=False,
 lazy_tables=True
 )
except Exception, e:
db = DAL('postgres://richard_prod:password@127.0.0.1:5432/db',
pool_size=1, migrate_enabled=False,
 lazy_tables=True)

You surely can adapt to your case...

:)

Richard


On Wed, Jul 16, 2014 at 1:05 PM, Annet  wrote:

> I have a development and a deployment environment. In development all URLs
> are relative.
> The issue is I have 2 applications, 1 over http and 1 over https. When I
> move my
> applications to production I have to add scheme= ...and host=... to all
> URLs that are links
> between the 2 applications. Which is rather tedious and error prone.
>
> In production routes.py contains the following lines:
>
>
> routers = dict(
>   BASE  = dict(
>   domains = {
>   'www.domain.com' : 'init',
>   'my.domain.nl' : 'my',
>   }
>   ),
> )
>
> To solve my issue, is it possible to do something like:
>
> routers = dict(
>   BASE  = dict(
>   domains = {
>   'www.domain.com' : 'init',
>   'my.domain.nl' : 'my',
>   }
>   applications = {
> 'init' : 'http://www.domain.com',
> 'my' : 'https://my.domain.com',
>   ),
> )
>
> So, basically, a sort of reverse domains =
>
>
> 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.
>

-- 
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] Is it possible to get an _onclick prompt variable to send to the controller?

2014-07-17 Thread Richard Vézina
Yes, but I guess you need to pass it like that :

**{'*_onclick*': *"var reason=prompt('Reason for extending?'); return
reason;"*}

Richard


On Wed, Jul 16, 2014 at 8:09 PM,  wrote:

> Hi all,
>
> I started using web2py a week ago with little MVC experience.  I have a
> page displaying a database table using a SQLFORM.grid() where each row has
> buttons to extend a time variable or delete the row.  I want to add a
> pop-up prompt which asks the user why they are extending the time variable.
>
> My links in the controller displaying the database:
> ## instantiate row variable with database output
>
> links = [{'header': '', 'body': lambda row: A('extend',
>   _class='btn',
> *  _onclick="var
> reason=prompt('Reason for extending?'); return reason;",*
>   _href=URL('extend',
> args=[row.project_name, row.kill_date]))},
>  {'header': '', 'body': lambda row: A('kill',
>   _class='btn',
>   callback=URL('kill',
> args=[row.project_name]),
>   delete="tr")}]
>
> grid = SQLFORM.grid(, links=links, ...)
> return dict(form=grid)
>
> My view:
> {{extend 'layout.html'}}
> {{=form}}
>
> When I press the extend button, the prompt comes up and I can enter a
> string.  Where does that string go to and how do I access it so that I can
> use it in the 'extend' controller?  Is there a different way I should be
> doing this?
>
> Thanks,
> Jimmy
>
> --
> 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] Possible SQLCustomType bug with booleans

2014-07-17 Thread Eric
Hi There,

Today I needed to use a SQLCustomType to convert a boolean to a string (in 
view mode) and the other way around when storing it.

I used this customtype:

bool_to_text = SQLCustomType(
type='string',
native='boolean',
encoder=lambda value: SQLFormFilters.store_text_as_boolean(value),
decoder=lambda value: SQLFormFilters.view_boolean_as_text(value)
)

And this functions in the class

@staticmethod
def store_text_as_boolean(value):
if value == 'true':
return 'T'
else:
return 'F'

@staticmethod
def view_boolean_as_text(value):
if value == 'T':
return 'true'
else:
return 'false'

I needed to use this check:
value == 'T'

because it looks like the DAL is always giving back a string in this 
specific situation.

When I use:
value == True

Web2py crashes with this error: 

AttributeError: 'bool' object has no attribute 'replace'


Traceback (most recent call last):
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/restricted.py", line 220, in 
restricted
exec ccode in environment
  File 
"/home/eric/Projects/Web2Py/BricksSis/applications/portal/controllers/medication_templates.py",
 line 147, in 
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/globals.py", line 385, in 

self._caller = lambda f: f()
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/tools.py", line 3287, in f
return action(*a, **b)
  File 
"/home/eric/Projects/Web2Py/BricksSis/applications/portal/controllers/medication_templates.py",
 line 71, in edit
if form.process().accepted:
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/html.py", line 2282, in 
process
self.validate(**kwargs)
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/html.py", line 2219, in 
validate
if self.accepts(**kwargs):
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/sqlhtml.py", line 1590, in 
accepts
self.id_field_name]).update(**fields)
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 10549, in 
update
ret = db._adapter.update("%s" % table._tablename,self.query,fields)
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1612, in update
sql = self._update(tablename, query, fields)
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1607, in 
_update
for (field, value) in fields])
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1552, in expand
return str(self.represent(expression,field_type))
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 1978, in 
represent
return self.adapt(value)
  File "/home/eric/Projects/Web2Py/BricksSis/gluon/dal.py", line 775, in adapt
return "'%s'" % obj.replace("'", "''")
AttributeError: 'bool' object has no attribute 'replace'


Oh... I'm using SQLForms in the controller, the view contains a custom 
form, I'm printing the field like this:

{{=form.custom.widget.is_specialite}}


-- 
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: Getting "invalid view" when trying to access view as JSON

2014-07-17 Thread lyn2py
Because generic views are used on localhost. For security, production 
servers will not serve generic files. You either turn off that security 
(not recommended, do the next thing) or create the individual view files 
you need for the corresponding function/action in the controller.

On Thursday, July 17, 2014 6:13:46 PM UTC+8, John Drake wrote:
>
> This is odd.  On my local test server I can do something like:
>
> http://localhost:8000/myapp/mycontroller/myfunction.json
>
> and I get back a JSON document.  But when I try the same code on the same 
> application running on Pythonanywhere I get:
>
> invalid view (mycontroller/myfunction.json)
>
> Just to make sure it wasn't something I coded wrong, I tried this with the 
> built in "Welcome" app.
>
> https://johnmdrake.pythonanywhere.com/welcome/default/index.json
>
> I get the above error message.  If I do:
>
> http://localhost:8000/welcome/default/index.json
>
> I get the JSON doc I want.  What's going on 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: web2py vs others. Status of 2014

2014-07-17 Thread lyn2py
Ok, thank you for the response. :)

On Thursday, July 17, 2014 7:35:16 PM UTC+8, Massimo Di Pierro wrote:
>
>
>
> On Thursday, 17 July 2014 04:50:16 UTC-5, lyn2py wrote:
>>
>> Hi Massimo, probably a dumb question, but can you explain more why you 
>> would want to move the helper system and form generation to clients side? 
>> Thanks.
>>
>
> I think it would be nice to have a framework where the server only needs 
> to data (ajax web services) and the forms are generated by JS code based on 
> information provided by those services.
>  
>
>>
>> When do you foresee that Python 3 will takeover the world by storm and 
>> leave Python 2 permanently behind? And when will web3py be ready… hehehe...
>>
>
> Not soon ;-)
>  
>
>> I actually like the idea that for one time, web2py will break backward 
>> compatibility to create a better, lighter web2py. Probably won't happen 
>> until web3py, but I'm just dreaming :)
>>
>> Love it that DAL is staying no matter what :)
>>
>> On Tuesday, June 10, 2014 10:14:03 AM UTC+8, Massimo Di Pierro wrote:
>>>
>>>
>>> I think the future is a lighter web2py with a similar IDE but more 
>>> client-side logic out of the box and more automatic. For example I have 
>>> ported the web2py helper system (DIV, SPAN, etc.) to JS. I would like to 
>>> move form generation also clients-side. I would like move away from the MVC 
>>> and to a mini-MVC patter where an action is responsible for a single 
>>> component (for example validation) and not for an entire page. Wherever we 
>>> are going the DAL is staying! 
>>>
>>> 

-- 
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: Pinging Massimo: why Bottle as opposed to Flask?

2014-07-17 Thread Massimo Di Pierro
I find bottle to be small and very well written. Flask started as an 
April's fool joke and the name was supposed to make fun on Bottle. Flask 
sells itself as a micro-framework but it has a very large code based given 
the functionality it provides. 

If bottle existed when web2py started, I would have used it. We currently 
use piece from bottle in anyserver.py.

Massimo

On Thursday, 17 July 2014 05:36:55 UTC-5, Cliff Kachinske wrote:
>
> Massimo,
>
> In the Reddit thread you mentioned experimenting with Bottle + Dal. Why 
> Bottle?
>
> Thanks,
> Cliff Kachinske
>

-- 
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 vs others. Status of 2014

2014-07-17 Thread Massimo Di Pierro


On Thursday, 17 July 2014 04:50:16 UTC-5, lyn2py wrote:
>
> Hi Massimo, probably a dumb question, but can you explain more why you 
> would want to move the helper system and form generation to clients side? 
> Thanks.
>

I think it would be nice to have a framework where the server only needs to 
data (ajax web services) and the forms are generated by JS code based on 
information provided by those services.
 

>
> When do you foresee that Python 3 will takeover the world by storm and 
> leave Python 2 permanently behind? And when will web3py be ready… hehehe...
>

Not soon ;-)
 

> I actually like the idea that for one time, web2py will break backward 
> compatibility to create a better, lighter web2py. Probably won't happen 
> until web3py, but I'm just dreaming :)
>
> Love it that DAL is staying no matter what :)
>
> On Tuesday, June 10, 2014 10:14:03 AM UTC+8, Massimo Di Pierro wrote:
>>
>>
>> I think the future is a lighter web2py with a similar IDE but more 
>> client-side logic out of the box and more automatic. For example I have 
>> ported the web2py helper system (DIV, SPAN, etc.) to JS. I would like to 
>> move form generation also clients-side. I would like move away from the MVC 
>> and to a mini-MVC patter where an action is responsible for a single 
>> component (for example validation) and not for an entire page. Wherever we 
>> are going the DAL is staying! 
>>
>> 

-- 
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: Problem with Google Fonts

2014-07-17 Thread Leonel Câmara
Thiago by removing http it uses whatever protocol you're using. So my 
solution would also have worked. The reason for your problem is that when 
you request a webpage using HTTPS the browser blocks non-secure requests so 
HTTP is blocked.

I told you to use https:// instead of just // so it also works if you open 
the file locally. Whereas using // it would become *http://fonts.googleapis.com/css?family=Nunito>">*, which of course 
wouldn't work.

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


[web2py] Re: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Cliff Kachinske
It appears not to. 

If I put a print statement in there it never executes. If I tell it to 
return the value and some arbitrary string it doesn't happen.

On Thursday, July 17, 2014 6:56:41 AM UTC-4, Leonel Câmara wrote:
>
> Do you mean onvalidation? It's supposed to run your validators first.
>
>

-- 
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: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Leonel Câmara
Do you mean onvalidation? It's supposed to run your validators first.

-- 
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: Automatic actions based on date/time

2014-07-17 Thread 黄祥
for cron i think you can learned it from man cron on linux. for scheduler, 
please take a look at this discussion :
https://groups.google.com/forum/#!topic/web2py/EY4UCtTH35A

for your case, i think you can create the schedule for check the validity 
and compare it with the date time right now, after the condition is met 
than you can update/delete the value of the row and then execute db.commit()

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] Pinging Massimo: why Bottle as opposed to Flask?

2014-07-17 Thread Cliff Kachinske
Massimo,

In the Reddit thread you mentioned experimenting with Bottle + Dal. Why 
Bottle?

Thanks,
Cliff Kachinske

-- 
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] form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Cliff Kachinske
I use a custom validator for list:string fields.

If I use onvalidate with form.process, the validator is not called. 

It's easy to work around this situation, but it took some time to figure 
out what was going on. 

It might be beneficial to document this behavior.


-- 
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: Getting "invalid view" when trying to access view as JSON

2014-07-17 Thread Niphlod
directly from the book



   - If a view is not found, web2py tries to use a generic view. By 
   default, generic views are disabled, although the 'welcome' app includes 
   a line in /models/db.py to enable them on localhost only. They can be 
   enabled per extension type and per action (usingresponse.generic_patterns). 
   In general, generic views are a development tool and typically should 
   not be used in production. If you want some actions to use a generic view, 
   list those actions in response.generic_patterns (discussed in more 
   detail in the chapter on Services).


On Thursday, July 17, 2014 12:13:46 PM UTC+2, John Drake wrote:
>
> This is odd.  On my local test server I can do something like:
>
> http://localhost:8000/myapp/mycontroller/myfunction.json
>
> and I get back a JSON document.  But when I try the same code on the same 
> application running on Pythonanywhere I get:
>
> invalid view (mycontroller/myfunction.json)
>
> Just to make sure it wasn't something I coded wrong, I tried this with the 
> built in "Welcome" app.
>
> https://johnmdrake.pythonanywhere.com/welcome/default/index.json
>
> I get the above error message.  If I do:
>
> http://localhost:8000/welcome/default/index.json
>
> I get the JSON doc I want.  What's going on 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] Getting "invalid view" when trying to access view as JSON

2014-07-17 Thread John Drake
This is odd.  On my local test server I can do something like:

http://localhost:8000/myapp/mycontroller/myfunction.json

and I get back a JSON document.  But when I try the same code on the same 
application running on Pythonanywhere I get:

invalid view (mycontroller/myfunction.json)

Just to make sure it wasn't something I coded wrong, I tried this with the 
built in "Welcome" app.

https://johnmdrake.pythonanywhere.com/welcome/default/index.json

I get the above error message.  If I do:

http://localhost:8000/welcome/default/index.json

I get the JSON doc I want.  What's going on 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.


Re: [web2py] Trolls at work against web2py!

2014-07-17 Thread Don O'Hara
If I ignore my bias to web2py, and the fact that I have no empirical evidence 
as far as real world applications,
it is interesting that :

   -  Only Massimo's posts give references to links, other studies, and real 
evidence, in a calm, unopinionated manner

   - Detractors tend to give  off the cuff and non-professional comments (e.g. 
"WTF" is not a very professional response), although
   they claim to produce "large scale, professional sites, by professional 
developers". 

 In other words, instead of presenting a reason pro or con, and buildling an 
argument with evidence,
like Massimo does, detractors just reply with off-the-cuff, 
this-happened-to-me, i-dont-like-that-you-use-exec,
etc etc. Massimo's responses could appear in a peer-reviewed article, the 
others, well, reddit is reddit.

C'est la vie! A tool is a tool; not every tool is perfect for every job. 

Thanks for keeping up with the "trolls", Massimo !!

Don


On Jul 17, 2014, at 2:22, Massimo Di Pierro  wrote:

> http://www.reddit.com/r/Python/comments/2awyjd/web2py/
> 
> -- 
> 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: web2py vs others. Status of 2014

2014-07-17 Thread lyn2py
Hi Massimo, probably a dumb question, but can you explain more why you 
would want to move the helper system and form generation to clients side? 
Thanks.

When do you foresee that Python 3 will takeover the world by storm and 
leave Python 2 permanently behind? And when will web3py be ready… hehehe...

I actually like the idea that for one time, web2py will break backward 
compatibility to create a better, lighter web2py. Probably won't happen 
until web3py, but I'm just dreaming :)

Love it that DAL is staying no matter what :)

On Tuesday, June 10, 2014 10:14:03 AM UTC+8, Massimo Di Pierro wrote:
>
>
> I think the future is a lighter web2py with a similar IDE but more 
> client-side logic out of the box and more automatic. For example I have 
> ported the web2py helper system (DIV, SPAN, etc.) to JS. I would like to 
> move form generation also clients-side. I would like move away from the MVC 
> and to a mini-MVC patter where an action is responsible for a single 
> component (for example validation) and not for an entire page. Wherever we 
> are going the DAL is staying! 
>
> 

-- 
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: Trolls at work against web2py!

2014-07-17 Thread lyn2py
Kudos to Massimo for your replies to the comments on Reddit, in spite of 
their negativity. I have learned more about web2py from your replies. I 
would help speak up for web2py if I could, but I am considered very young 
to the history of python frameworks and cannot hold a conversation on that.

I just wanted to add that I did a lot of research and contemplating before 
arriving at the decision to use web2py, and has never regretted since. I 
have never been happier coding. Web2py can do a lot of magic for you, and 
then later when you want to make your own custom magic, you can always turn 
off web2py's built-in magic. That means you can prototype fast, deploy fast 
and customize as necessary at your own pace. And it doesn't take a lot of 
learning to do that. 

I am not sure I understand why they would comment "difficult to maintain". 
I mean, I could go back to an app I wrote 2 years ago and get a hang of it 
quickly (which hasn't happened before… I'll be feeling so dreadful if I had 
to edit any code previous to web2py). 

I hope that your passion to continue to support and add to this framework 
will persist in spite of negative comments. Thank you Massimo!



On Thursday, July 17, 2014 2:22:25 PM UTC+8, Massimo Di Pierro wrote:
>
> http://www.reddit.com/r/Python/comments/2awyjd/web2py/
>

-- 
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: Automatic actions based on date/time

2014-07-17 Thread ceriox
thanks, can you post an little example or a reference to the manual? 

sorry i'm not a good programmer :(

Il giorno giovedì 17 luglio 2014 11:19:31 UTC+2, Niphlod ha scritto:
>
> use cron or, even better, the scheduler.
>
> On Thursday, July 17, 2014 10:27:09 AM UTC+2, ceriox wrote:
>>
>> Hello,
>> i need to execute istructions after a specific date and time.
>>
>> for example in a table i have a field called "validity" and it is a date 
>> time field
>> the record is valid until this date/time (validity field) , when it is 
>> over i need to execute some instruction.
>>
>> (i'm doing a shop for food products, i need to hide products who they 
>> aren't good anymore and delete/modify the incopletes orders with bad 
>> products)
>>
>> how can i do it?
>>
>> thanks for help
>>
>>

-- 
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: Automatic actions based on date/time

2014-07-17 Thread Niphlod
use cron or, even better, the scheduler.

On Thursday, July 17, 2014 10:27:09 AM UTC+2, ceriox wrote:
>
> Hello,
> i need to execute istructions after a specific date and time.
>
> for example in a table i have a field called "validity" and it is a date 
> time field
> the record is valid until this date/time (validity field) , when it is 
> over i need to execute some instruction.
>
> (i'm doing a shop for food products, i need to hide products who they 
> aren't good anymore and delete/modify the incopletes orders with bad 
> products)
>
> how can i do it?
>
> thanks for help
>
>

-- 
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 vs others. Status of 2014

2014-07-17 Thread Arnon Marcus
Massimo is right - the future is a fatter client and thinner server (Hell, 
it's already "the present", or even "the past"...)

I like exactly the technologies Massimo mentioned, with some additions.
I opened a few google-groups for integration of Ember, Angular and the 
like, but then life happened and I had other things to do...
Plus, from gauging future trends, it seems even Angular and Ember are about 
to go "obsolete", or at the very least undergo such a massive fundamental 
change, that it would be difficult (at least for me) to justify learning 
them as they are today...

*There are 2 "main" reasons for that (there are actually more then 2...):*
*1. Web Components* : An umbrella-term referring to a set of 
emerging-standards that allow for OOP-style declarative HTML 
(Encapsulation, Inheritance, etc.), with built-in support for 
2-way-databinding, templating, and ultimately "Extending the HTML language 
with custom features" (most everything Angular, and to some degree Ember, 
are doing today) - but all in a stardard-way, supported by all browsers 
(which means, cross-framework component-sharing, performance improvements 
to these features, etc.). To me, this may change web-development so 
fundamentally, that it should be named HTML6 or something...

*2. ECMAScript 6* *[The next version of JavaScript]* : Too much to mention 
here about it, but this is also a very fundamental shift of 
design-architecture of client-side frameworks, which is GOING to change 
MANY framework's APIs.

Angular has already declared support for these two technologies in the 
future iteration of it (2.x) in many occasions, and stated that it will be 
very different (think braking-changes to the API) - They are actually 
cooperating with the standards-bodies and iterating on the specs of 
web-components.

Ember has also stated similar statements, with braking-changes to the API 
of the 2.x release, and is also deeply involved with the standards-bodies 
(Yehuda Katz, one of the 2 main founders of the framework, actually has a 
seat at some relevant standards-body, and is actively contributing to the 
spec).
Another relevant-project to mention here is HTMLBars, which is a 
replacement templating-engine for Handlebars for Ember (sorta...), which 
mimics a lot of what's in both Angular and Web-components in terms of 
syntax (It can actually be used outside of Ember...).

This means that the ground is shifting beneath such framework's feet - 
which means, it's not a good time to make any long-term investment in them 
(in my view).
This is one of the major-reasons I stopped-short of investing in 
integrating them with web2py...

2 other notable technologies are the actual web-protocols: Web-Sockets and 
HTTP2.

The direction the whole web-stack is moving towards, is a combination of 
HTTP for "initial" loading of "pages" and/or "components", with MVC on the 
client, and then Web-Sockets for all data-interchange (between client and 
server) after that.
This offers the best performance AND usability for users and developers.

And even without Python 3.4's async features, that last point is already 
achieved with technologies like G-event and Socket.io, and can easily 
leverage, and be used in conjunction with,  web2py's amazing DAL (speaking 
from personal-experience).

To conclude, I think that if web2py is to have any future at all, this is 
the direction it should be aiming at - having a dual-server arrangement, 
with an HTTP(1.1/2.0) server for initial loading, and component-setup via 
ajax, and then a WebSocket server for all data-intensive interchange - all 
using common APIs, but in a shared-nothing arrangement of 2 types of 
server-processes (IPC may be introduced at some point after that).

On Tuesday, June 10, 2014 5:14:03 AM UTC+3, Massimo Di Pierro wrote:
>
> Good questions.
>
> Web2py has changed less in the last year than in the year before and most 
> of the changes have been small improvements and strengthening security. In 
> my view web2py is a very mature project and users do not want big changes 
> at this point. We have some todo items including a more flexible grid, 
> better CSS customization. I personally did not find much to learn from 
> Django and Rails in the last few years instead I am much more interested in 
> the async capabilities of Python 3.4, and in some javascript libraries like 
> Angular, Ember, and Ractive (my favorite), by hypermedia APIs, and by 
> Semantic-UI.
>
> I think the future is a lighter web2py with a similar IDE but more 
> client-side logic out of the box and more automatic. For example I have 
> ported the web2py helper system (DIV, SPAN, etc.) to JS. I would like to 
> move form generation also clients-side. I would like move away from the MVC 
> and to a mini-MVC patter where an action is responsible for a single 
> component (for example validation) and not for an entire page. Wherever we 
> are going the DAL is staying! 
>
> Massimo
>
>
>
> On Monday, 9 June 2014 07:01:39 UTC-

[web2py] Automatic actions based on date/time

2014-07-17 Thread ceriox
Hello,
i need to execute istructions after a specific date and time.

for example in a table i have a field called "validity" and it is a date 
time field
the record is valid until this date/time (validity field) , when it is over 
i need to execute some instruction.

(i'm doing a shop for food products, i need to hide products who they 
aren't good anymore and delete/modify the incopletes orders with bad 
products)

how can i do it?

thanks for help

-- 
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: Compiling web2py application to run as a native windows app

2014-07-17 Thread 黄祥
i think you can achieve it using batch file, power shell or autoit (for 
make *.exe). if you want to use https please create it manually using 
openssl and put it on the folder.
e.g. bat file
c:\test\web2py\test.bat

@echo off

C:\Python27\python.exe web2py.py -c test.crt -k test.key 
--interfaces=0.0.0.0:80;0.0.0.0:443:test.key:test.crt -p 443

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.