[web2py] user-created documentation

2017-03-06 Thread Alex Glaros
I built a quick and dirty user-created documentation system where for each 
topic, there is 1:M stakeholder-perspective content.

Am asking the group if there might be a little less-dirty, less quick 
method.

Here is what currently exists:

Example, for inventory system documentation there is for each topic, 
documentation for these stakeholders:
1. business side documentation
2. programmer documentation
3. database administration documentation
4. architecture documentation

It works okay with text fields containing the documentation. E.g.,

TOPIC_TABLE
1. title (how to enter inventory data)

STAKEHOLDER_TABLE
1. topic_ID  (1)
2. stakeholder_type_ID (database administrator)
3. content (text field, displayed with "pre" tag)

The goal is to promote collaboration between business side, tech side by 
having the content for a topic laid out by stakeholder perspective, side-by 
side.

Just wondering if there are any ideas to improve this without requiring 
users to learn Sphinx or more complicated methods.

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: Custom form errors?

2017-03-06 Thread LoveWeb2py
If I'm reading this 
correctly: 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Hide-errors

It looks like everything is now handled in the view and NOT the controller, 
so I'd need to do all of my checks in the view. Does that sound right?

On Tuesday, March 7, 2017 at 1:31:32 AM UTC-5, LoveWeb2py wrote:
>
> Thank you, Anthony, but I'm using a custom form via the "user" controller. 
>
> Here is my code
>
>  {{=form.custom.begin}}
> 
>
>   
>
> {{form.custom.widget.username.update(_placeholder="Username")}}
>{{=form.custom.widget.username}}
>   
>
>
>
>   
>   
>
> {{form.custom.widget.password.update(_placeholder="Password")}}
>{{=form.custom.widget.password}}
>
>
>
>
>   
>  
> 
> Remember me
> 
>  
>
>  
> Forgot 
> password?
>  
>   
>
>
>
>   
>{{=form.custom.submit}}
>  
>   
>
>
>
>   Or
>   
>  
> 
> Facebook Sign in
> 
>  
>  
> 
> Twitter Sign in
> 
>  
>   
>   Don't have an account?  href="{{=URL('default','register')}}">Create New
>
> 
>{{=form.custom.end}}
>
>
> I tried putting the functions you mentioned in the process and validate 
> method in the "user" function, but still no luck.
>
> On Tuesday, March 7, 2017 at 12:39:18 AM UTC-5, Anthony wrote:
>>
>> See 
>> http://web2py.com/books/default/chapter/29/07/forms-and-validators#The-process-and-validate-methods
>>  
>> and 
>> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Hide-errors
>> .
>>
>> After processing, errors are stored in form.errors (to get the error for 
>> a given field, use form.errors[fieldname]).
>>
>> Anthony
>>
>> On Tuesday, March 7, 2017 at 12:06:45 AM UTC-5, LoveWeb2py wrote:
>>>
>>> Hello,
>>>
>>> I have some custom login forms and I'm something like this:
>>>
>>>
>>> {{=form.custom.begin}}Image name: 
>>> {{=form.custom.widget.name}}Image file: 
>>> {{=form.custom.widget.file}}Click here to upload: 
>>> {{=form.custom.submit}}{{=form.custom.end}}
>>>
>>> How can I check for errors here?
>>>
>>> I'm lost at where form gets checked. For example, if the user types an 
>>> invalid password or username, I'd like to generate a custom message with 
>>> response.flash or something to that nature.
>>>
>>>

-- 
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: Custom form errors?

2017-03-06 Thread LoveWeb2py
Thank you, Anthony, but I'm using a custom form via the "user" controller. 

Here is my code

 {{=form.custom.begin}}

   
  
   
{{form.custom.widget.username.update(_placeholder="Username")}}
   {{=form.custom.widget.username}}
  
   

   
  
  
   
{{form.custom.widget.password.update(_placeholder="Password")}}
   {{=form.custom.widget.password}}

   

   
  
 

Remember me

 

 
Forgot 
password?
 
  
   

   
  
   {{=form.custom.submit}}
 
  
   

   
  Or
  
 

Facebook Sign in

 
 

Twitter Sign in

 
  
  Don't have an account? Create 
New
   

   {{=form.custom.end}}


I tried putting the functions you mentioned in the process and validate 
method in the "user" function, but still no luck.

On Tuesday, March 7, 2017 at 12:39:18 AM UTC-5, Anthony wrote:
>
> See 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#The-process-and-validate-methods
>  
> and 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Hide-errors
> .
>
> After processing, errors are stored in form.errors (to get the error for a 
> given field, use form.errors[fieldname]).
>
> Anthony
>
> On Tuesday, March 7, 2017 at 12:06:45 AM UTC-5, LoveWeb2py wrote:
>>
>> Hello,
>>
>> I have some custom login forms and I'm something like this:
>>
>>
>> {{=form.custom.begin}}Image name: 
>> {{=form.custom.widget.name}}Image file: 
>> {{=form.custom.widget.file}}Click here to upload: 
>> {{=form.custom.submit}}{{=form.custom.end}}
>>
>> How can I check for errors here?
>>
>> I'm lost at where form gets checked. For example, if the user types an 
>> invalid password or username, I'd like to generate a custom message with 
>> response.flash or something to that nature.
>>
>>

-- 
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: Custom form errors?

2017-03-06 Thread Anthony
See 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#The-process-and-validate-methods
 
and 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Hide-errors.

After processing, errors are stored in form.errors (to get the error for a 
given field, use form.errors[fieldname]).

Anthony

On Tuesday, March 7, 2017 at 12:06:45 AM UTC-5, LoveWeb2py wrote:
>
> Hello,
>
> I have some custom login forms and I'm something like this:
>
>
> {{=form.custom.begin}}Image name: 
> {{=form.custom.widget.name}}Image file: 
> {{=form.custom.widget.file}}Click here to upload: 
> {{=form.custom.submit}}{{=form.custom.end}}
>
> How can I check for errors here?
>
> I'm lost at where form gets checked. For example, if the user types an 
> invalid password or username, I'd like to generate a custom message with 
> response.flash or something to that nature.
>
>

-- 
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] Custom form errors?

2017-03-06 Thread LoveWeb2py
Hello,

I have some custom login forms and I'm something like this:


{{=form.custom.begin}}Image name: {{=form.custom.widget.name}}Image 
file: {{=form.custom.widget.file}}Click here to upload: 
{{=form.custom.submit}}{{=form.custom.end}}

How can I check for errors here?

I'm lost at where form gets checked. For example, if the user types an invalid 
password or username, I'd like to generate a custom message with response.flash 
or something to that nature.

-- 
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: pythonanywhere configuration domain web2py application

2017-03-06 Thread Jim S
Login to your pythonanywhere account.  Click on the Web tab.

Click on your web app on the left.

It should show you something like this:

DNS setup:
How to point your domain at your website.


CNAME: webapp-xx.pythonanywhere.com

where xx is a 6 digit number.

Go to you DNS setup with your registrar and create a CNAME record pointing 
your domain, www.asdbluestars-bz.it to the cname entry from pythonanywhere.

Make sense?

-Jim



On Monday, March 6, 2017 at 4:22:26 PM UTC-6, Alessio Varalta wrote:
>
> Hi, I have buy a domain on aruba and paid account on pythonanywhere.
>
> My domain is www.asdbluestars-bz.it
> My application run on https://alessiovic.pythonanywhere.com/bluestars/
> So I rename in Web of pythonanywhere the application like 
> www.asdbluestars-bz.it and after i see a new field
>
> Dns setup How to point your domain at your website. CNAME cname_value
>
> But now? I go to aruba and in manage domain and in Record CName section.
>
> Now i can add new cname and i have two field 
>
> Host
> Cname
>
> I suppose host is Cname cname_value of pythonanywhere and cname is 
> www.asdbluestars-bz.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: limitby question

2017-03-06 Thread Dave S


On Monday, March 6, 2017 at 5:50:05 PM UTC-8, Anthony wrote:
>
> What is your question? If you want to do an offset, you need two numbers 
> -- either the two endpoints of the interval or one endpoint plus the size 
> of the interval. Whichever pair of numbers you have, it is a single 
> arithmetic operation to get the alternative pair. It might help if you 
> explain what two numbers you would prefer to work with and where you are 
> getting them.
>
> Anthony
>

Is the issue perhaps cognitive dissonance caused by "min" and "max" being 
different from Richard's concept of "offset"?  I can see that if you're 
used to applying min and max to the* values*, you might be disturbed by 
applying them to the *indices*.

/dps


> On Monday, March 6, 2017 at 4:11:52 PM UTC-5, Richard wrote:
>>
>> Hello,
>>
>> I may not understanding something... I am desapointed that I can't simply 
>> manipulate offset of the sql... Or should I just manipulate the limit...
>>
>> I mean if I do repetitively thise query in sql :
>>
>> select * form table order by desc limit 10 offset 0
>> select * form table order by desc limit 10 offset 10
>> select * form table order by desc limit 10 offset 20
>> select * form table order by desc limit 10 offset 30
>>
>> I will get progressively all the records from the table 10 at a time...
>>
>> But I can't simply do it with this query :
>>
>> rows = db((db.table.id > 0)
>>   ).select(db.table.id, db.table.represent_field,
>>orderby=~db.table.id,
>>limitby=(10, offset if offset else 0))
>>
>> Reading the book there seems to have planty of backend that don't support 
>> paging with limit and offset properly...
>>
>> But still I find it frustrasting to have to struggle with the DAL and 
>> have to provide min and max for the offset to a limitby function which 
>> isn't a limit but an offset in reallity...
>>
>> I solve it with this :
>>
>> offset = request.vars.limit_by
>> if offset not in ('None', '', None) and offset.isdigit():
>> offset = int(offset)
>> min = offset - 10
>> max = offset
>> else:
>> offset = None
>> min = 0
>> max = 10
>>
>> rows = db((db.table.id > 0)
>>   ).select(db.table.id, db.table.represent_field,
>>orderby=~db.table.id,
>>limitby=(min, max))
>>
>>
>> Richard
>>
>>
>>

-- 
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: ajax_trap=False behavior on ajax loaded component

2017-03-06 Thread Anthony


Then load it as an Ajax component and the form will not be trapped.

Anthony

On Friday, March 3, 2017 at 3:38:55 PM UTC-5, Carlos Cesar Caballero wrote:
>
> Hi, I am using a component who has a form like this: 
>
>  
>   
>  Option 1 
>  Option 2 
>   
>  Go 
>  
>
> As you can see is a simple form who does a get request to another 
> controller (it could be easily done with two links but the requirement 
> needs a form) 
>
> If I call the component using "ajax=False" it works without problems, 
> but it needs to be reloaded by actions occurring in others components in 
> the page and for that it needs to be called with "ajax=True" (if I use 
> "ajax=False" i can't call the component javascript reload() function) 
> the problem is that "ajax=True" traps the call inside the div and 
> ignores the "ajax_trap=False" option. 
>
> Is there a way to load via ajax a component with a form but don't trap 
> it inside the div? 
>
> Greetings. 
>

-- 
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: limitby question

2017-03-06 Thread Anthony
What is your question? If you want to do an offset, you need two numbers -- 
either the two endpoints of the interval or one endpoint plus the size of 
the interval. Whichever pair of numbers you have, it is a single arithmetic 
operation to get the alternative pair. It might help if you explain what 
two numbers you would prefer to work with and where you are getting them.

Anthony

On Monday, March 6, 2017 at 4:11:52 PM UTC-5, Richard wrote:
>
> Hello,
>
> I may not understanding something... I am desapointed that I can't simply 
> manipulate offset of the sql... Or should I just manipulate the limit...
>
> I mean if I do repetitively thise query in sql :
>
> select * form table order by desc limit 10 offset 0
> select * form table order by desc limit 10 offset 10
> select * form table order by desc limit 10 offset 20
> select * form table order by desc limit 10 offset 30
>
> I will get progressively all the records from the table 10 at a time...
>
> But I can't simply do it with this query :
>
> rows = db((db.table.id > 0)
>   ).select(db.table.id, db.table.represent_field,
>orderby=~db.table.id,
>limitby=(10, offset if offset else 0))
>
> Reading the book there seems to have planty of backend that don't support 
> paging with limit and offset properly...
>
> But still I find it frustrasting to have to struggle with the DAL and have 
> to provide min and max for the offset to a limitby function which isn't a 
> limit but an offset in reallity...
>
> I solve it with this :
>
> offset = request.vars.limit_by
> if offset not in ('None', '', None) and offset.isdigit():
> offset = int(offset)
> min = offset - 10
> max = offset
> else:
> offset = None
> min = 0
> max = 10
>
> rows = db((db.table.id > 0)
>   ).select(db.table.id, db.table.represent_field,
>orderby=~db.table.id,
>limitby=(min, max))
>
>
> Richard
>
>
>

-- 
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: Feature request [?]

2017-03-06 Thread Anthony
Why not just use alternative delimiters with Vue -- so in your Vue 
templates, instead of @{{...}}, you might have @{...}@, or any other 
alternative?

Anthony

On Monday, March 6, 2017 at 3:48:09 PM UTC-5, marco mansilla wrote:
>
> Hi, I'm a long time web2py user and most of us. Latety I've been deep 
> learning about useful js libraries and frameworks, I've worked a lot with 
> jQuery and it just works fine, then went to test ractive, reactjs and 
> angular, did some small stuff with the latest. But the issue most of the 
> times has been with the delimiters, a long time ago read in some answer 
> from Massimo that it would be ok to change {{  }} delimiters from web2py 
> instead of the js framework, but sometimes it's confusing since there are 
> different kind of delimiters, and doing it on every project having to 
> update the default code in the templates is annoying.
>
> Lately I've been learning VueJs and love it, small, functional, practical 
> but has the same delimiters, and reading some docs and watching some videos 
> found out that blade (template engine from laravel), has some nice features 
> on this, before delimiters collide in the template it has the option to 
> write something like:
>
> @{{   foobar  }}
>
> so the content inside those delimiters are ignored by the template engine, 
> so no need to change delimiters, since blade also uses double curly braces, 
> which makes it easy to play with others. Would be possible so implement 
> something like this in future versions?.
>
> Hope this no to be a dumb request.
>
> Marco.
>

-- 
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] pythonanywhere configuration domain web2py application

2017-03-06 Thread Alessio Varalta
Hi, I have buy a domain on aruba and paid account on pythonanywhere.

My domain is www.asdbluestars-bz.it
My application run on https://alessiovic.pythonanywhere.com/bluestars/
So I rename in Web of pythonanywhere the application like 
www.asdbluestars-bz.it 
and after i see a new field

Dns setup How to point your domain at your website. CNAME cname_value

But now? I go to aruba and in manage domain and in Record CName section.

Now i can add new cname and i have two field 

Host
Cname

I suppose host is Cname cname_value of pythonanywhere and cname is 
www.asdbluestars-bz.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] limitby question

2017-03-06 Thread Richard
Hello,

I may not understanding something... I am desapointed that I can't simply 
manipulate offset of the sql... Or should I just manipulate the limit...

I mean if I do repetitively thise query in sql :

select * form table order by desc limit 10 offset 0
select * form table order by desc limit 10 offset 10
select * form table order by desc limit 10 offset 20
select * form table order by desc limit 10 offset 30

I will get progressively all the records from the table 10 at a time...

But I can't simply do it with this query :

rows = db((db.table.id > 0)
  ).select(db.table.id, db.table.represent_field,
   orderby=~db.table.id,
   limitby=(10, offset if offset else 0))

Reading the book there seems to have planty of backend that don't support 
paging with limit and offset properly...

But still I find it frustrasting to have to struggle with the DAL and have 
to provide min and max for the offset to a limitby function which isn't a 
limit but an offset in reallity...

I solve it with this :

offset = request.vars.limit_by
if offset not in ('None', '', None) and offset.isdigit():
offset = int(offset)
min = offset - 10
max = offset
else:
offset = None
min = 0
max = 10

rows = db((db.table.id > 0)
  ).select(db.table.id, db.table.represent_field,
   orderby=~db.table.id,
   limitby=(min, max))


Richard


-- 
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] Feature request [?]

2017-03-06 Thread marco mansilla
Hi, I'm a long time web2py user and most of us. Latety I've been deep 
learning about useful js libraries and frameworks, I've worked a lot with 
jQuery and it just works fine, then went to test ractive, reactjs and 
angular, did some small stuff with the latest. But the issue most of the 
times has been with the delimiters, a long time ago read in some answer 
from Massimo that it would be ok to change {{  }} delimiters from web2py 
instead of the js framework, but sometimes it's confusing since there are 
different kind of delimiters, and doing it on every project having to 
update the default code in the templates is annoying.

Lately I've been learning VueJs and love it, small, functional, practical 
but has the same delimiters, and reading some docs and watching some videos 
found out that blade (template engine from laravel), has some nice features 
on this, before delimiters collide in the template it has the option to 
write something like:

@{{   foobar  }}

so the content inside those delimiters are ignored by the template engine, 
so no need to change delimiters, since blade also uses double curly braces, 
which makes it easy to play with others. Would be possible so implement 
something like this in future versions?.

Hope this no to be a dumb request.

Marco.

-- 
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: Unpickling error

2017-03-06 Thread Jordan Myers
It would help if you gave us some more context. Where does this error 
occur? What are you trying to do? The error seems to be when you are 
creating tables in the file db2.py, what are the contents of this file?

On Monday, March 6, 2017 at 10:08:04 AM UTC-6, Maurice Waka wrote:
>
> Am getting this web2py error in Ubuntu: 
>
> Traceback (most recent call last):
>   File "/home/mwk/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/home/mwk/web2py/applications/britamintell/models/db2.py", line 15, 
> in 
> auth.signature)
>   File "/home/mwk/web2py/gluon/packages/dal/pydal/base.py", line 834, in 
> define_table
> table = self.lazy_define_table(tablename,*fields,**args)
>   File "/home/mwk/web2py/gluon/packages/dal/pydal/base.py", line 873, in 
> lazy_define_table
> polymodel=polymodel)
>   File "/home/mwk/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 500, in create_table
> sql_fields_old = pickle.load(tfile)UnpicklingError: invalid load key, '�'.
>
> what is this and how do i resolve 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] web2py + apache2 can't load Theano (Ubuntu Server 14.04)

2017-03-06 Thread Jordan Myers
Hello

I've migrated my code to start using Apache2 after successful setup just 
using built-in Rocket server, but now for some reason loading Theano leads 
to import error. I thought maybe the issue was with Cython or something, 
but it will successfully import NumPy, Scipy, Gensim, and other libraries 
that are compiled to c. Again, Theano worked fine in old Rocket setup. 

Does anyone have an idea of what the issue is? If it helps, I once got a 
different error that Theano complained about not having access to write 
compile logs, but I then corrected that issue by modifying permissions in 
the applicable folder and the error just goes back to being a normal 
"cannot import module applications.[myapp].modules.theano" Theano is 
installed in /usr/*local*/lib/python2.7/dist-packages/ (verified by running 
help('theano') in python prompt) instead of 
/usr/lib/python2.7/dist-packages/ in case that's relevant.

Thanks for any suggestions,
-Jordan

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


[web2py] Re: how to open web2py console shell on my windows 8 ??

2017-03-06 Thread Dave S


On Monday, March 6, 2017 at 10:41:25 AM UTC-8, Dave S wrote:
>
>
>
> On Saturday, March 4, 2017 at 10:50:41 PM UTC-8, Paul Ellis wrote:
>>
>> Hi Anthony,
>>
>> I am using Windows 10 and have replaced web2py.py with web2py.exe and am 
>> getting this error:
>>
>> python web2py.exe -s [application] -m
>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
>> no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
>> details
>>
>> I have also tried: 
>> python web2py.exe
>>
>> e:\web2py\py web2py.exe
>> this gives a traceback, but the same error:
>> Traceback (most recent call last):
>>   File "", line 6, in 
>>   File "__main__.py", line 126, in 
>>   File "__main__py__.py", line 60, in 
>>   File "web2py.exe", line 1
>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
>> no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
>> details
>>
>> What am I doing wrong?
>>
>> Cheers
>>
>>
> Leave off the "python ".   Web2py*.exe* has it's python built-in, and is 
> wrapped with a launcher, hence the .exe.
>
>
Also, this branch of the thread is duplicated at
https://groups.google.com/d/topic/web2py/T1OH6haDHHM/discussion>
 

> /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: how to open web2py console shell on my windows 8 ??

2017-03-06 Thread Dave S


On Saturday, March 4, 2017 at 10:50:41 PM UTC-8, Paul Ellis wrote:
>
> Hi Anthony,
>
> I am using Windows 10 and have replaced web2py.py with web2py.exe and am 
> getting this error:
>
> python web2py.exe -s [application] -m
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> I have also tried: 
> python web2py.exe
>
> e:\web2py\py web2py.exe
> this gives a traceback, but the same error:
> Traceback (most recent call last):
>   File "", line 6, in 
>   File "__main__.py", line 126, in 
>   File "__main__py__.py", line 60, in 
>   File "web2py.exe", line 1
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> What am I doing wrong?
>
> Cheers
>
>
Leave off the "python ".   Web2py*.exe* has it's python built-in, and is 
wrapped with a launcher, hence the .exe.

/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] initialize component via js

2017-03-06 Thread Manuele Pesenti
Il 06/03/17 17:27, Richard Vézina ha scritto:
> See at the end of LOAD section in the book
> : 
> http://web2py.com/books/default/chapter/29/12/components-and-plugins?search=web2py_component#LOAD

Wow! Thanks... I'll give it a try.

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: ajax_trap=False behavior on ajax loaded component

2017-03-06 Thread LightDot
Perhaps someone can make an alternative suggestion if you explain what 
exactly does a form do if it isn't trapped by ajax_trap. Does it refresh 
the page, redirect, something else..?

Regards

On Friday, March 3, 2017 at 9:38:55 PM UTC+1, Carlos Cesar Caballero wrote:
>
> Hi, I am using a component who has a form like this: 
>
>  
>   
>  Option 1 
>  Option 2 
>   
>  Go 
>  
>
> As you can see is a simple form who does a get request to another 
> controller (it could be easily done with two links but the requirement 
> needs a form) 
>
> If I call the component using "ajax=False" it works without problems, 
> but it needs to be reloaded by actions occurring in others components in 
> the page and for that it needs to be called with "ajax=True" (if I use 
> "ajax=False" i can't call the component javascript reload() function) 
> the problem is that "ajax=True" traps the call inside the div and 
> ignores the "ajax_trap=False" option. 
>
> Is there a way to load via ajax a component with a form but don't trap 
> it inside the div? 
>
> Greetings. 
>

-- 
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: Autoincrement which resets each month (not primary id)

2017-03-06 Thread Richard Vézina
Anthony is right...

In my case I had to manage such kind of custom primary key generation... I
use onvalidation() make a callback and find the sequence field and
increment it... I have some function to generate the item id or custom
primary key that contains the logic to increment properly the sequence
field as the sequence may depend of different other field input. As
sequence can be reused if it the last one with no consequence a simple
"last sequence value + 1" is sufficient. It proves resilient to as if
someone for some reason delete previous sequence the system doesn't care as
it just take the greatest last sequence record to iterate over it to find
the next sequence. No one never report any issue since it in place back to
2010, so...

Having another table to manage the increment is a good idea and may prevent
to have to do a callback to find the last highest sequence value... But you
can't use a surrogate id field as for instance in postgres id are burn for
ever once used in case insert failed of if you delete a record. It depends
if you can reuse a sequence if the last input get delete or not.

So the rules that you need to follow to generate you custom primary key has
to be clear and procedured, or if not procedured you need to make it clears
with your client with a URS (user riqurements).

Richard

On Mon, Mar 6, 2017 at 11:01 AM, Anthony  wrote:

> The problem with any solution that inspects the current records in the
> database table in order to figure out the ID for a new record is that you
> will not be able to account for deleted records (i.e., you might end up
> re-using IDs that were previously used by records that were later deleted).
> This approach also requires an extra query for every insert and has a
> potential race condition (unless you select for update).
>
> Instead, you would probably need to store the starting record ID of the
> first record each month externally (e.g., in a separate db table). To avoid
> having to query that extra table before each insert, you could use the
> web2py cache to cache the current month's value and update it with a query
> only once a month.
>
> Anthony
>
>
> On Sunday, March 5, 2017 at 6:23:27 PM UTC-5, 黄祥 wrote:
>>
>> perhaps you can use count
>> *e.g.*
>> count_invoice = db.invoice.id.count()
>> this_year = request.now.year
>> this_month = request.now.month
>>
>> query_invoice = ((db.invoice.invoice_date.year() == this_year) &
>> (db.invoice.invoice_date.month() == this_month) )
>> query_count_invoice = db(query_invoice).select(count
>> _invoice).first()[count_invoice] if db(query_invoice).select() else 0
>>
>> invoice_no_count = int(query_count_invoice) + 1 if query_count_invoice
>> else 1
>> invoice_no_format_count = format(invoice_no_count, '05')
>>
>> invoice_no = request.now.strftime('%y%m')+invoice_no_format_count
>>
>> 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.


Re: [web2py] initialize component via js

2017-03-06 Thread Richard Vézina
See at the end of LOAD section in the book :
http://web2py.com/books/default/chapter/29/12/components-and-plugins?search=web2py_component#LOAD

On Mon, Mar 6, 2017 at 11:25 AM, Richard Vézina  wrote:

> web2py_component() ??
>
> Richard
>
> On Mon, Mar 6, 2017 at 11:07 AM, Manuele Pesenti <
> manuele.pese...@gmail.com> wrote:
>
>> Hi!
>>
>> Would it be possible to initialize a new component via javascript?
>>
>> I would like to dinamically define a component inside a bootstrap modal
>> object and than initialize it.
>>
>> I've tryied with reload command but it does not work... it gave me this
>> error:
>>
>> TypeError: jQuery(...).get(...).reload is not a function
>>
>> Any suggestion?
>>
>> Thanks
>>
>> Cheers
>>
>> Manuele
>>
>>
>> --
>> 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] initialize component via js

2017-03-06 Thread Richard Vézina
web2py_component() ??

Richard

On Mon, Mar 6, 2017 at 11:07 AM, Manuele Pesenti 
wrote:

> Hi!
>
> Would it be possible to initialize a new component via javascript?
>
> I would like to dinamically define a component inside a bootstrap modal
> object and than initialize it.
>
> I've tryied with reload command but it does not work... it gave me this
> error:
>
> TypeError: jQuery(...).get(...).reload is not a function
>
> Any suggestion?
>
> Thanks
>
> Cheers
>
> Manuele
>
>
> --
> 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] Unpickling error

2017-03-06 Thread Maurice Waka
 

Am getting this web2py error in Ubuntu: 

Traceback (most recent call last):
  File "/home/mwk/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/mwk/web2py/applications/britamintell/models/db2.py", line 15, in 

auth.signature)
  File "/home/mwk/web2py/gluon/packages/dal/pydal/base.py", line 834, in 
define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "/home/mwk/web2py/gluon/packages/dal/pydal/base.py", line 873, in 
lazy_define_table
polymodel=polymodel)
  File "/home/mwk/web2py/gluon/packages/dal/pydal/adapters/base.py", line 500, 
in create_table
sql_fields_old = pickle.load(tfile)UnpicklingError: invalid load key, '�'.

what is this and how do i resolve 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] initialize component via js

2017-03-06 Thread Manuele Pesenti
Hi!

Would it be possible to initialize a new component via javascript?

I would like to dinamically define a component inside a bootstrap modal
object and than initialize it.

I've tryied with reload command but it does not work... it gave me this
error:

TypeError: jQuery(...).get(...).reload is not a function

Any suggestion?

Thanks

Cheers

Manuele


-- 
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: Autoincrement which resets each month (not primary id)

2017-03-06 Thread Anthony
The problem with any solution that inspects the current records in the 
database table in order to figure out the ID for a new record is that you 
will not be able to account for deleted records (i.e., you might end up 
re-using IDs that were previously used by records that were later deleted). 
This approach also requires an extra query for every insert and has a 
potential race condition (unless you select for update).

Instead, you would probably need to store the starting record ID of the 
first record each month externally (e.g., in a separate db table). To avoid 
having to query that extra table before each insert, you could use the 
web2py cache to cache the current month's value and update it with a query 
only once a month.

Anthony

On Sunday, March 5, 2017 at 6:23:27 PM UTC-5, 黄祥 wrote:
>
> perhaps you can use count 
> *e.g.*
> count_invoice = db.invoice.id.count()
> this_year = request.now.year
> this_month = request.now.month
>
> query_invoice = ((db.invoice.invoice_date.year() == this_year) & 
> (db.invoice.invoice_date.month() == this_month) )
> query_count_invoice = 
> db(query_invoice).select(count_invoice).first()[count_invoice] if 
> db(query_invoice).select() else 0
>
> invoice_no_count = int(query_count_invoice) + 1 if query_count_invoice 
> else 1
> invoice_no_format_count = format(invoice_no_count, '05')
>
> invoice_no = request.now.strftime('%y%m')+invoice_no_format_count
>
> 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: Python web2py console

2017-03-06 Thread Anthony
If using the Windows binary, the .exe file includes the Python interpreter, 
so you don't run it using your system's installed Python. Instead, it would 
be:

web2py.exe -S application -M

Also, note that S and M are capitalized.

Anyway, the point of the binary .exe file is for systems that do not have 
Python installed. If you have Python installed, it would be preferable to 
just use the source version of web2py -- don't bother with the .exe version.

Anthony

On Monday, March 6, 2017 at 7:14:34 AM UTC-5, Paul Ellis wrote:
>
> Hello, 
>
> I know this question has been asked before, but didn't solve the problem 
> for me.
>
> I am using Windows 10 and web2py binary and have replaced web2py.py with 
> web2py.exe in the command python web2py.py -s [applicaiton] -m and am 
> getting this error:
>
> python web2py.exe -s [application] -m
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> I have also tried: 
> python web2py.exe
>
> e:\web2py\py web2py.exe
> this gives a traceback, but the same error:
> Traceback (most recent call last):
>   File "", line 6, in 
>   File "__main__.py", line 126, in 
>   File "__main__py__.py", line 60, in 
>   File "web2py.exe", line 1
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> What am I doing wrong?
>
> Cheers
>

-- 
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: new experimental feature in trunk - rows.join(...)

2017-03-06 Thread Marlysson Silva
It ever good have the software tested.

Desenvolvedor Frontend com um pé no Backend , e vice-versa.
Github: github.com/Marlysson
Email : marlyss...@gmail.com
Portfolio: marlysson.github.io/portfolio

2017-03-06 12:24 GMT-03:00 Richard Vézina :

> I would not say it good practice but not all contrib that have been
> include are tested... But it definitly a good idea to test it properly and
> have test, so if the core change and you code break you know were it from
> (which commit to the core) as long as these tests are included in test suit.
>
> Richard
>
> On Mon, Mar 6, 2017 at 10:21 AM, Marlysson Silva 
> wrote:
>
>> The tests in contrib module are made by creator of module ( the core
>> developer of web2py don't test them ) .
>>
>> Desenvolvedor Frontend com um pé no Backend , e vice-versa.
>> Github: github.com/Marlysson
>> Email : marlyss...@gmail.com
>> Portfolio: marlysson.github.io/portfolio
>>
>> 2017-03-06 12:19 GMT-03:00 Jurgis Pralgauskis <
>> jurgis.pralgaus...@gmail.com>:
>>
>>> I'd like to.
>>> But it needs review and tests, I guess.
>>>
>>> 2017-03-06 17:00 "Richard Vézina"  rašė:
>>>
 Hello Jurgis, maybe it could be included as a contrib??

 Because as Giovanni mention, your proposal would make the DAL more of
 an ORM in case it been included.

 Richard

 On Sun, Mar 5, 2017 at 11:44 PM, Jurgis Pralgauskis <
 jurgis.pralgaus...@gmail.com> wrote:

> You can try mu plugin
>
> https://github.com/dz0/web2py_grand_helpers/blob/master/plug
> ins/modules/plugin_joins_builder/joins_builder.py
>
> Also mentioned as proposal
> https://github.com/web2py/pydal/issues/432
>
> --
> 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 a topic in the
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit https://groups.google.com/d/to
 pic/web2py/_xQUWYXZG54/unsubscribe.
 To unsubscribe from this group and all its topics, 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/web2py/_xQUWYXZG54/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/_xQUWYXZG54/unsubscribe.
> To unsubscribe from this group and all its topics, 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...@goog

Re: [web2py] Re: new experimental feature in trunk - rows.join(...)

2017-03-06 Thread Richard Vézina
I would not say it good practice but not all contrib that have been include
are tested... But it definitly a good idea to test it properly and have
test, so if the core change and you code break you know were it from (which
commit to the core) as long as these tests are included in test suit.

Richard

On Mon, Mar 6, 2017 at 10:21 AM, Marlysson Silva 
wrote:

> The tests in contrib module are made by creator of module ( the core
> developer of web2py don't test them ) .
>
> Desenvolvedor Frontend com um pé no Backend , e vice-versa.
> Github: github.com/Marlysson
> Email : marlyss...@gmail.com
> Portfolio: marlysson.github.io/portfolio
>
> 2017-03-06 12:19 GMT-03:00 Jurgis Pralgauskis <
> jurgis.pralgaus...@gmail.com>:
>
>> I'd like to.
>> But it needs review and tests, I guess.
>>
>> 2017-03-06 17:00 "Richard Vézina"  rašė:
>>
>>> Hello Jurgis, maybe it could be included as a contrib??
>>>
>>> Because as Giovanni mention, your proposal would make the DAL more of an
>>> ORM in case it been included.
>>>
>>> Richard
>>>
>>> On Sun, Mar 5, 2017 at 11:44 PM, Jurgis Pralgauskis <
>>> jurgis.pralgaus...@gmail.com> wrote:
>>>
 You can try mu plugin

 https://github.com/dz0/web2py_grand_helpers/blob/master/plug
 ins/modules/plugin_joins_builder/joins_builder.py

 Also mentioned as proposal
 https://github.com/web2py/pydal/issues/432

 --
 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/web2py/_xQUWYXZG54/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/_xQUWYXZG54/unsubscribe.
>> To unsubscribe from this group and all its topics, 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] Re: new experimental feature in trunk - rows.join(...)

2017-03-06 Thread Marlysson Silva
The tests in contrib module are made by creator of module ( the core
developer of web2py don't test them ) .

Desenvolvedor Frontend com um pé no Backend , e vice-versa.
Github: github.com/Marlysson
Email : marlyss...@gmail.com
Portfolio: marlysson.github.io/portfolio

2017-03-06 12:19 GMT-03:00 Jurgis Pralgauskis 
:

> I'd like to.
> But it needs review and tests, I guess.
>
> 2017-03-06 17:00 "Richard Vézina"  rašė:
>
>> Hello Jurgis, maybe it could be included as a contrib??
>>
>> Because as Giovanni mention, your proposal would make the DAL more of an
>> ORM in case it been included.
>>
>> Richard
>>
>> On Sun, Mar 5, 2017 at 11:44 PM, Jurgis Pralgauskis <
>> jurgis.pralgaus...@gmail.com> wrote:
>>
>>> You can try mu plugin
>>>
>>> https://github.com/dz0/web2py_grand_helpers/blob/master/plug
>>> ins/modules/plugin_joins_builder/joins_builder.py
>>>
>>> Also mentioned as proposal
>>> https://github.com/web2py/pydal/issues/432
>>>
>>> --
>>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/_xQUWYXZG54/unsubscribe.
>> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/_xQUWYXZG54/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: new experimental feature in trunk - rows.join(...)

2017-03-06 Thread Jurgis Pralgauskis
I'd like to.
But it needs review and tests, I guess.

2017-03-06 17:00 "Richard Vézina"  rašė:

> Hello Jurgis, maybe it could be included as a contrib??
>
> Because as Giovanni mention, your proposal would make the DAL more of an
> ORM in case it been included.
>
> Richard
>
> On Sun, Mar 5, 2017 at 11:44 PM, Jurgis Pralgauskis <
> jurgis.pralgaus...@gmail.com> wrote:
>
>> You can try mu plugin
>>
>> https://github.com/dz0/web2py_grand_helpers/blob/master/plug
>> ins/modules/plugin_joins_builder/joins_builder.py
>>
>> Also mentioned as proposal
>> https://github.com/web2py/pydal/issues/432
>>
>> --
>> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/_xQUWYXZG54/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: new experimental feature in trunk - rows.join(...)

2017-03-06 Thread Richard Vézina
Hello Jurgis, maybe it could be included as a contrib??

Because as Giovanni mention, your proposal would make the DAL more of an
ORM in case it been included.

Richard

On Sun, Mar 5, 2017 at 11:44 PM, Jurgis Pralgauskis <
jurgis.pralgaus...@gmail.com> wrote:

> You can try mu plugin
>
> https://github.com/dz0/web2py_grand_helpers/blob/master/
> plugins/modules/plugin_joins_builder/joins_builder.py
>
> Also mentioned as proposal
> https://github.com/web2py/pydal/issues/432
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: Python web2py console

2017-03-06 Thread Marlysson Silva
python web2py.exe -S your_application -M

Em segunda-feira, 6 de março de 2017 11:14:53 UTC-3, Paul Ellis escreveu:
>
> Yes. I want an interactive shell with my application loaded.
>
> I know I can run a 'Test' page with output to the console, but it would be 
> much easier (and I know possible) if I could use an interactive shell.
>
> I have seen Massimo using it in his videos. But I can' t get the command 
> to work.
>
> On Mon, Mar 6, 2017 at 2:36 PM, Marlysson Silva  > wrote:
>
>> Try just double click in web2py.exe , it open a server in a screen.
>>
>> Or are you trying accessing models of application via shell?
>>
>> Em segunda-feira, 6 de março de 2017 09:14:34 UTC-3, Paul Ellis escreveu:
>>
>>> Hello, 
>>>
>>> I know this question has been asked before, but didn't solve the problem 
>>> for me.
>>>
>>> I am using Windows 10 and web2py binary and have replaced web2py.py with 
>>> web2py.exe in the command python web2py.py -s [applicaiton] -m and am 
>>> getting this error:
>>>
>>> python web2py.exe -s [application] -m
>>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, 
>>> but no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
>>> details
>>>
>>> I have also tried: 
>>> python web2py.exe
>>>
>>> e:\web2py\py web2py.exe
>>> this gives a traceback, but the same error:
>>> Traceback (most recent call last):
>>>   File "", line 6, in 
>>>   File "__main__.py", line 126, in 
>>>   File "__main__py__.py", line 60, in 
>>>   File "web2py.exe", line 1
>>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, 
>>> but no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
>>> details
>>>
>>> What am I doing wrong?
>>>
>>> Cheers
>>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/T1OH6haDHHM/unsubscribe.
>> To unsubscribe from this group and all its topics, 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.


Re: [web2py] Re: Python web2py console

2017-03-06 Thread Marlysson Silva
try:

python web2py.exe -S your_application -M



Em segunda-feira, 6 de março de 2017 11:14:53 UTC-3, Paul Ellis escreveu:
>
> Yes. I want an interactive shell with my application loaded.
>
> I know I can run a 'Test' page with output to the console, but it would be 
> much easier (and I know possible) if I could use an interactive shell.
>
> I have seen Massimo using it in his videos. But I can' t get the command 
> to work.
>
> On Mon, Mar 6, 2017 at 2:36 PM, Marlysson Silva  > wrote:
>
>> Try just double click in web2py.exe , it open a server in a screen.
>>
>> Or are you trying accessing models of application via shell?
>>
>> Em segunda-feira, 6 de março de 2017 09:14:34 UTC-3, Paul Ellis escreveu:
>>
>>> Hello, 
>>>
>>> I know this question has been asked before, but didn't solve the problem 
>>> for me.
>>>
>>> I am using Windows 10 and web2py binary and have replaced web2py.py with 
>>> web2py.exe in the command python web2py.py -s [applicaiton] -m and am 
>>> getting this error:
>>>
>>> python web2py.exe -s [application] -m
>>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, 
>>> but no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
>>> details
>>>
>>> I have also tried: 
>>> python web2py.exe
>>>
>>> e:\web2py\py web2py.exe
>>> this gives a traceback, but the same error:
>>> Traceback (most recent call last):
>>>   File "", line 6, in 
>>>   File "__main__.py", line 126, in 
>>>   File "__main__py__.py", line 60, in 
>>>   File "web2py.exe", line 1
>>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, 
>>> but no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
>>> details
>>>
>>> What am I doing wrong?
>>>
>>> Cheers
>>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/T1OH6haDHHM/unsubscribe.
>> To unsubscribe from this group and all its topics, 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.


Re: [web2py] Re: Python web2py console

2017-03-06 Thread Paul Ellis
Yes. I want an interactive shell with my application loaded.

I know I can run a 'Test' page with output to the console, but it would be
much easier (and I know possible) if I could use an interactive shell.

I have seen Massimo using it in his videos. But I can' t get the command to
work.

On Mon, Mar 6, 2017 at 2:36 PM, Marlysson Silva 
wrote:

> Try just double click in web2py.exe , it open a server in a screen.
>
> Or are you trying accessing models of application via shell?
>
> Em segunda-feira, 6 de março de 2017 09:14:34 UTC-3, Paul Ellis escreveu:
>
>> Hello,
>>
>> I know this question has been asked before, but didn't solve the problem
>> for me.
>>
>> I am using Windows 10 and web2py binary and have replaced web2py.py with
>> web2py.exe in the command python web2py.py -s [applicaiton] -m and am
>> getting this error:
>>
>> python web2py.exe -s [application] -m
>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but
>> no encoding declared; see http://python.org/dev/peps/pep-0263/ for
>> details
>>
>> I have also tried:
>> python web2py.exe
>>
>> e:\web2py\py web2py.exe
>> this gives a traceback, but the same error:
>> Traceback (most recent call last):
>>   File "", line 6, in 
>>   File "__main__.py", line 126, in 
>>   File "__main__py__.py", line 60, in 
>>   File "web2py.exe", line 1
>> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but
>> no encoding declared; see http://python.org/dev/peps/pep-0263/ for
>> details
>>
>> What am I doing wrong?
>>
>> Cheers
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/T1OH6haDHHM/unsubscribe.
> To unsubscribe from this group and all its topics, 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: Python web2py console

2017-03-06 Thread Marlysson Silva
Try just double click in web2py.exe , it open a server in a screen.

Or are you trying accessing models of application via shell?

Em segunda-feira, 6 de março de 2017 09:14:34 UTC-3, Paul Ellis escreveu:
>
> Hello, 
>
> I know this question has been asked before, but didn't solve the problem 
> for me.
>
> I am using Windows 10 and web2py binary and have replaced web2py.py with 
> web2py.exe in the command python web2py.py -s [applicaiton] -m and am 
> getting this error:
>
> python web2py.exe -s [application] -m
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> I have also tried: 
> python web2py.exe
>
> e:\web2py\py web2py.exe
> this gives a traceback, but the same error:
> Traceback (most recent call last):
>   File "", line 6, in 
>   File "__main__.py", line 126, in 
>   File "__main__py__.py", line 60, in 
>   File "web2py.exe", line 1
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> What am I doing wrong?
>
> Cheers
>

-- 
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: Python web2py console

2017-03-06 Thread Marlysson Silva
Try just double click in web2py.exe , it open a screen server.

Em segunda-feira, 6 de março de 2017 09:14:34 UTC-3, Paul Ellis escreveu:
>
> Hello, 
>
> I know this question has been asked before, but didn't solve the problem 
> for me.
>
> I am using Windows 10 and web2py binary and have replaced web2py.py with 
> web2py.exe in the command python web2py.py -s [applicaiton] -m and am 
> getting this error:
>
> python web2py.exe -s [application] -m
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> I have also tried: 
> python web2py.exe
>
> e:\web2py\py web2py.exe
> this gives a traceback, but the same error:
> Traceback (most recent call last):
>   File "", line 6, in 
>   File "__main__.py", line 126, in 
>   File "__main__py__.py", line 60, in 
>   File "web2py.exe", line 1
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
>
> What am I doing wrong?
>
> Cheers
>

-- 
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: Autoincrement which resets each month (not primary id)

2017-03-06 Thread Kiran Subbaraman
For the trigger ... you could also consider using the web2py support for 
on insert / on update callbacks: 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert-delete-and-update



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Mon, 06-03-2017 5:39 PM, Paul Ellis wrote:

Hey Brian,

Doing it on the fly won't work because I want the number to be set at 
record creation and be a part of the dataset. Also, this is what I am 
already doing.


Using a database trigger is something I don't know anything about. So 
thank you for the nudge, I will research this option.


Paul

On Mon, Mar 6, 2017 at 1:03 AM, Brian M > wrote:


First of all, at the risk of asking a silly question - is there
actually a reason to store this secondary ID in the database
rather than just have it calculated on the fly as-needed using a
virtual field? Assuming that you've got a created_date field
already in the table that'll give you the month portion and then
there's definitely an id field to give you that so just let web2py
figure it out for you on-the-fly

|

Field.Virtual('human_id',lambdarow:int(row.your_table.created_date.strftime('%y%m0'))+row.your_table.id)
|

The above would cause a record created today (2017-03-05) that had
id = 123 to return a human_id of 170300123 which is I think what
you want. Note the extra zeros tacked on to the end of the
strftime they are important so that when you add the ID you don't
accidentally increment your month number - be sure to include
enough to ensure that you can cover the highest realistic record
ID (and then add an extra zero :D). Alternatively, you may wish to
consider changing your human ID format to something like
yymm-## so that you don't have to worry about inadvertently
messing up your date related portion and it is perhaps slightly
easier for humans to understand which is presumably important
because I don't get why you'd want to include the year and month
if it isn't supposed to mean anything to the user.

db.your_table.human_id =
Field.Virtual('human_id',lambda 
row:'{0}-{1}'.format(row.your_table.created_date.strftime('%y%m')
+'-'+ row.your_table.id), table_name = 'your_table')

If you need to actually store it in the database then you'll have
to work more.  Sadly, web2py's computed fields won't work because
they don't know the ID before the insert. That leaves you with
doing it DB side. MySQL appears to only lets you have one
auto-increment per table so unfortunately you can't have both your
actual primary key ID and a second human readable monthly ID (that
would intentionally be reset to something like 170300 this
month and 170400 next).  What I'd consider is creating a DB
trigger that would take care of automatically populating your
secondary ID for you all within the database so that there's
nothing for you to manage. So on insert the database could
automatically look at the date (or use an existing created_date
field) and the current auto-increment number and combine as needed
and store it for you.

~Brian



On Sunday, March 5, 2017 at 11:26:51 AM UTC-6, Paul Ellis wrote:

I want to have a numbering system which is 2 digit year, 2
digit month and then an autoincrement number which resets each
month. 1703#

Currently using SQLite with a view to move to MYSQL in future.
The MYSQL examples I have found suggest using a composite
primary key, which doesn't seem to fit too well with web2py.

The reason I am trying for autoincrement is so the database
ensures the numbers are unique. I am willing to look at
another way if I am sure I won't end up with 2 identical numbers.

At the moment I have it working with
datetime.date.today().strftime('%y%m') + id. So I am half way
there, but can't see how to reset each month. I guess I can
check for the highest number in the database programmatically,
but I am worried about duplicate numbers with a high number of
users. This also seems like if the document with the highest
number was deleted (but possibly already printed), then the
number will be reused.

The program uses the actual primary key for all backend work.
This is just an identifier for humans, but the documents
produced by the program can't afford to have the same number
as another document.

Can someone give me a nudge in the right direction, I am a bit
stuck?

-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues

Re: [web2py] Re: VirtualField in select?

2017-03-06 Thread Jurgis Pralgauskis
my solution
https://github.com/dz0/web2py_grand_helpers/blob/72910a0b82e7e50de6d09b635cfd7855f85abc65/plugins/controllers/plugin_AnySQLFORM.py#L544


2017-03-05 09:23 "Jurgis Pralgauskis"  rašė:

> Sorry for no example. I want sth like:
>
> dbset.smart_select(field1, *vfield2*, field3)
>
> And get the corresponding row structure (without extra actions).
>
> And
> field3.readable = False
> could hide it in final structure.
>
>
>
> 2017-03-05 00:39 "Anthony"  rašė:
>
>> On Saturday, March 4, 2017 at 6:15:29 AM UTC-5, Jurgis Pralgauskis wrote:
>>>
>>> Hi,
>>>
>>> I would like to have SQLFORM.grid  behaviour for VirtualField, but  I
>>> want get rows instead of TABLE.
>>>
>>> And grid doesn't fit my needs, as it doesn't let Expression
>>> ... and I don't
>>> neceserrily need represented values, but raw instead..
>>>
>>> So what's the best way to hack it?
>>>
>>
>> It's not quite clear what your requirements are, so hard to say.
>>
>> --
>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/jilgqy_HMHQ/unsubscribe.
>> To unsubscribe from this group and all its topics, 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] Python web2py console

2017-03-06 Thread Paul Ellis
Hello, 

I know this question has been asked before, but didn't solve the problem 
for me.

I am using Windows 10 and web2py binary and have replaced web2py.py with 
web2py.exe in the command python web2py.py -s [applicaiton] -m and am 
getting this error:

python web2py.exe -s [application] -m
SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

I have also tried: 
python web2py.exe

e:\web2py\py web2py.exe
this gives a traceback, but the same error:
Traceback (most recent call last):
  File "", line 6, in 
  File "__main__.py", line 126, in 
  File "__main__py__.py", line 60, in 
  File "web2py.exe", line 1
SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

What am I doing wrong?

Cheers

-- 
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: Autoincrement which resets each month (not primary id)

2017-03-06 Thread Paul Ellis
Hey Brian,

Doing it on the fly won't work because I want the number to be set at
record creation and be a part of the dataset. Also, this is what I am
already doing.

Using a database trigger is something I don't know anything about. So thank
you for the nudge, I will research this option.

Paul

On Mon, Mar 6, 2017 at 1:03 AM, Brian M  wrote:

> First of all, at the risk of asking a silly question - is there actually a
> reason to store this secondary ID in the database rather than just have it
> calculated on the fly as-needed using a virtual field? Assuming that you've
> got a created_date field already in the table that'll give you the month
> portion and then there's definitely an id field to give you that so just
> let web2py figure it out for you on-the-fly
>
> Field.Virtual('human_id', lambda row: int(row.your_table.created_date.
> strftime('%y%m0')) + row.your_table.id)
>
> The above would cause a record created today (2017-03-05) that had id =
> 123 to return a human_id of 170300123 which is I think what you want. Note
> the extra zeros tacked on to the end of the strftime they are important so
> that when you add the ID you don't accidentally increment your month number
> - be sure to include enough to ensure that you can cover the highest
> realistic record ID (and then add an extra zero :D). Alternatively, you may
> wish to consider changing your human ID format to something like
> yymm-## so that you don't have to worry about inadvertently messing up
> your date related portion and it is perhaps slightly easier for humans to
> understand which is presumably important because I don't get why you'd want
> to include the year and month if it isn't supposed to mean anything to the
> user.
>
> db.your_table.human_id = Field.Virtual('human_id', lambda row:
> '{0}-{1}'.format(row.your_table.created_date.strftime('%y%m') +'-' + row.
> your_table.id), table_name = 'your_table')
>
> If you need to actually store it in the database then you'll have to work
> more.  Sadly, web2py's computed fields won't work because they don't know
> the ID before the insert. That leaves you with doing it DB side. MySQL
> appears to only lets you have one auto-increment per table so unfortunately
> you can't have both your actual primary key ID and a second human readable
> monthly ID (that would intentionally be reset to something like 170300
> this month and 170400 next).  What I'd consider is creating a DB
> trigger that would take care of automatically populating your secondary ID
> for you all within the database so that there's nothing for you to manage.
> So on insert the database could automatically look at the date (or use an
> existing created_date field) and the current auto-increment number and
> combine as needed and store it for you.
>
> ~Brian
>
>
>
> On Sunday, March 5, 2017 at 11:26:51 AM UTC-6, Paul Ellis wrote:
>>
>> I want to have a numbering system which is 2 digit year, 2 digit month
>> and then an autoincrement number which resets each month. 1703#
>>
>> Currently using SQLite with a view to move to MYSQL in future. The MYSQL
>> examples I have found suggest using a composite primary key, which doesn't
>> seem to fit too well with web2py.
>>
>> The reason I am trying for autoincrement is so the database ensures the
>> numbers are unique. I am willing to look at another way if I am sure I
>> won't end up with 2 identical numbers.
>>
>> At the moment I have it working with datetime.date.today().strftime('%y%m')
>> + id. So I am half way there, but can't see how to reset each month. I
>> guess I can check for the highest number in the database programmatically,
>> but I am worried about duplicate numbers with a high number of users. This
>> also seems like if the document with the highest number was deleted (but
>> possibly already printed), then the number will be reused.
>>
>> The program uses the actual primary key for all backend work. This is
>> just an identifier for humans, but the documents produced by the program
>> can't afford to have the same number as another document.
>>
>> Can someone give me a nudge in the right direction, I am a bit stuck?
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/hH_O_mUV4rw/unsubscribe.
> To unsubscribe from this group and all its topics, 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 subsc