[web2py] Re: how to get currently logged in user name for the component embedded in the wiki text area

2018-09-03 Thread 98ujko9
I think I have answered myself. This does the job:
db.define_table('comments',
Field('logged_in_user', 'reference auth_user', 
default=auth.user_id),
Field('user_comment', 'text',requires=IS_NOT_EMPTY()),
   )


On Monday, September 3, 2018 at 12:02:24 PM UTC-4, 98u...@gmail.com wrote:
>
> i am getting the error:
>  'NoneType' object has no attribute 
> 'first_name'.
> Field('logged_in_user', 'string',auth.user.first_name),
> AttributeError: 'NoneType' object has no attribute 'first_name'
>
>
> the site is behind the login page and even when I attempt to go the 
> homepage (can't open the site) I get above error. Because initially no user 
> is logged in and the table code is executed early on it seems to me.
>
> the model for component:
>
> db.define_table('comments',
> Field('logged_in_user', 'string', 
> default=auth.user.first_name),
> Field('user_comment', requires=IS_NOT_EMPTY()))
>
> the controller:
>
> @auth.requires_login()def manage_comments():
> return SQLFORM.grid(db.comments)
>
>
> This is embedded as text in the text-area field of the markmin wiki:
>
> @{component:default/manage_comments}
>
>
> Thanks in advance for any assistance!
>

-- 
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] how to get currently logged in user name for the component embedded in the wiki text area

2018-09-03 Thread 98ujko9
i am getting the error:
 'NoneType' object has no attribute 
'first_name'.
Field('logged_in_user', 'string',auth.user.first_name),
AttributeError: 'NoneType' object has no attribute 'first_name'


the site is behind the login page and even when I attempt to go the 
homepage (can't open the site) I get above error. Because initially no user 
is logged in and the table code is executed early on it seems to me.

the model for component:

db.define_table('comments',
Field('logged_in_user', 'string', 
default=auth.user.first_name),
Field('user_comment', requires=IS_NOT_EMPTY()))

the controller:

@auth.requires_login()def manage_comments():
return SQLFORM.grid(db.comments)


This is embedded as text in the text-area field of the markmin wiki:

@{component:default/manage_comments}


Thanks in advance for any assistance!

-- 
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.smartgrid - Query Not Supported: (1066, "Not unique table/alias: 'a_table'")

2018-05-14 Thread 98ujko9
I am a weekend coder and my queries probably need to be redesigned. I was 
trying to move everything to a newer environment and immediately weak areas 
fail first. In time I should be able to sort things out. I do enjoy working 
with web2py . Thanks for your input.

On Monday, May 14, 2018 at 10:48:12 AM UTC-4, Anthony wrote:
>
> I don't see the left join queries for 2.16.11. Anyway, maybe try running 
> the different queries in a separate MySQL client and see if you can 
> reproduce the error to isolate the problem.
>
> Anthony
>
> On Saturday, May 12, 2018 at 1:40:51 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> db stats for 2.16.11
>>
>> SELECT `labour`.`lab_description`, `labour`.`lab_id` FROM `labour` WHERE 
>> ((`labour`.`lab_id` IS NOT NULL) AND (`labour`.`lab_term_date` IS NULL)) 
>> ORDER BY `labour`.`lab_description`, `labour`.`lab_id`;
>>
>> 1.11ms
>> ---
>>
>> db stats for 2.9.11
>>
>> SET FOREIGN_KEY_CHECKS=1;
>>
>> 1.31ms
>>
>> SET sql_mode='NO_BACKSLASH_ESCAPES';
>>
>> 1.29ms
>>
>> SELECT  labour.lab_description, labour.lab_id FROM labour WHERE 
>> ((labour.lab_id IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
>> labour.lab_description, labour.lab_id;
>>
>> 9.32ms
>>
>> SELECT  labour.lab_description, labour.lab_id FROM labour WHERE 
>> ((labour.lab_id IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
>> labour.lab_description, labour.lab_id;
>>
>> 9.07ms
>>
>> SELECT  count(*) FROM labour LEFT JOIN labprice ON ((labour.lab_id = 
>> labprice.lp_lab_id) AND (labprice.lp_term_date IS NULL)) WHERE 
>> (labprice.lp_id IS NOT NULL);
>>
>> 2.57ms
>>
>> SELECT  labprice.lp_id, labprice.lp_lab_id, labprice.lp_unit_price, 
>> labprice.lp_comment, labprice.lp_intro_date FROM labour LEFT JOIN labprice 
>> ON ((labour.lab_id = labprice.lp_lab_id) AND (labprice.lp_term_date IS 
>> NULL)) WHERE (labprice.lp_id IS NOT NULL) ORDER BY labour.lab_description;
>>
>> 47.51ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 97) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.12ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 112) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.09ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.04ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.03ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.03ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.05ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.04ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.02ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 125) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.06ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 120) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.06ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 128) AND (labour.lab_term_date IS NULL)) LIMIT 1 
>> OFFSET 0;
>>
>> 2.02ms
>>
>> SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
>> labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour 
>> WHERE ((labour.lab_id = 118) AND (labour.lab_term_date IS NULL)) LIMIT 1 

[web2py] Re: SQLFORM.smartgrid - Query Not Supported: (1066, "Not unique table/alias: 'a_table'")

2018-05-12 Thread 98ujko9
db stats for 2.16.11

SELECT `labour`.`lab_description`, `labour`.`lab_id` FROM `labour` WHERE 
((`labour`.`lab_id` IS NOT NULL) AND (`labour`.`lab_term_date` IS NULL)) ORDER 
BY `labour`.`lab_description`, `labour`.`lab_id`;

1.11ms
---

db stats for 2.9.11

SET FOREIGN_KEY_CHECKS=1;

1.31ms

SET sql_mode='NO_BACKSLASH_ESCAPES';

1.29ms

SELECT  labour.lab_description, labour.lab_id FROM labour WHERE ((labour.lab_id 
IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
labour.lab_description, labour.lab_id;

9.32ms

SELECT  labour.lab_description, labour.lab_id FROM labour WHERE ((labour.lab_id 
IS NOT NULL) AND (labour.lab_term_date IS NULL)) ORDER BY 
labour.lab_description, labour.lab_id;

9.07ms

SELECT  count(*) FROM labour LEFT JOIN labprice ON ((labour.lab_id = 
labprice.lp_lab_id) AND (labprice.lp_term_date IS NULL)) WHERE (labprice.lp_id 
IS NOT NULL);

2.57ms

SELECT  labprice.lp_id, labprice.lp_lab_id, labprice.lp_unit_price, 
labprice.lp_comment, labprice.lp_intro_date FROM labour LEFT JOIN labprice ON 
((labour.lab_id = labprice.lp_lab_id) AND (labprice.lp_term_date IS NULL)) 
WHERE (labprice.lp_id IS NOT NULL) ORDER BY labour.lab_description;

47.51ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 97) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.12ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 112) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.09ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.04ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 113) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.03ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.03ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 90) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.05ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.04ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 86) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.02ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 125) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.06ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 120) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.06ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 128) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.02ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 118) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.03ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 33) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.03ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 114) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.03ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 119) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;

2.01ms

SELECT  labour.lab_id, labour.lab_description, labour.lab_intro_date, 
labour.lab_term_date, labour.lab_term_id, labour.lab_comment FROM labour WHERE 
((labour.lab_id = 18) AND (labour.lab_term_date IS NULL)) LIMIT 1 OFFSET 0;


[web2py] SQLFORM.smartgrid - Query Not Supported: (1066, "Not unique table/alias: 'a_table'")

2018-05-12 Thread 98ujko9
After update from web2py 2.9.11  (mysql 5.6.37) to web2py 2.16.11 (mysql 
5.6.40) the SQLFORM.smartgrid shows zero results and at the top right 
displays a message: Query Not Supported: (1066, "Not unique table/alias: 
'labprice'").
This same code works in 2.9.11:
db.labprice._common_filter = lambda query: 
db.labprice.lp_term_date==None
db.labour._common_filter = lambda query: db.labour.lab_term_date==None
left=db.labprice.on(db.labour.lab_id==db.labprice.lp_lab_id)
orderby=[db.labour.lab_description]
form 
=SQLFORM.smartgrid(db.labprice,left=left,fields=fields,headers=headers,paginate='all',maxtextlengths=maxtextlengths,maxtextlength=40,
 
buttons_placement='left',links_placement='left',deletable=False,orderby=orderby,linked_tables=['repair'])
Enter code here...

Any help in making it work in the newer version of web2py will be 
appreciated.
Thanks 

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


[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-29 Thread 98ujko9
I use the stock Rocket server that comes with web2py and I restart it 
 after changing the routes.py. I must say that I don't fully understand the 
big picture of how the apps the compiler and the operating system 
cooperate. One time I uploaded a site to GAE with two separate apps but the 
tables in the models were named the same. web2py saw the models as separate 
and GAE as one and both apps were accessing the tables of the first app 
only.
In this project I kept my apps separate because I wanted to have a generic 
versions of each that I can quickly reuse elsewhere. Now I see this design 
might be flawed. 
I will follow your advice and place the code under one app. I feel too, 
that I might have a glitch in my setup. 
Big thank you for the help with routes.

Thanks for your time.

On Tuesday, August 29, 2017 at 8:52:49 AM UTC-4, Anthony wrote:
>
> Using the same routes, I cannot replicate the generated URLs you observe. 
> Make sure you reload routes (via admin) or restart the web server.
>
> Also, do you really need a separate init app and notes app? Especially the 
> init app -- what is it doing? If it just provides a single home page, that 
> doesn't belong in a separate app.
>
> Anthony
>
> On Monday, August 28, 2017 at 7:57:39 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> I removed routes_in and routes_out. The routes.py file in the site's root 
>> looks like so:
>>
>>
>> routers = dict(
>> # base router
>> BASE=dict(
>> default_application='init',
>> ),
>> stock=dict(
>> default_function='index',
>> functions=dict(
>> default=['index','call','download','user',],
>> showcase=['index',]
>> )
>> ),
>> )
>>
>>
>> During development I launch the stock app from the administrative 
>> interface and the address bar shows:
>> https://192.168.1.25:8000/stock 
>> 
>> /default
>> During its running one  menu item STOCK (it serves as home button, 
>> beginning of listing) is visible, rendered by code:
>>
>> response.menu_stock = [(T('Stock'), False, 
>> URL('stock','default','index'), [])
>> ]
>>  upon clicking on it the address bar also shows:
>> https://192.168.1.25:8000/stock 
>> 
>> /default
>>
>> I have two more apps in this site:
>>
>> INIT- which is sort of like a facade for the website when you type the 
>> domain name in the browser it starts. 
>> I launch STOCK app from within INIT with the same menu construct as 
>> above. The browser also shows 'default'.
>>
>> NOTES- which are instructions to myself and my customer.
>>
>> I may add more apps in this project down the road.
>>
>> Curious, when I launch the app through address bar by typing: 
>> https://192.168.1.25:8000/stock 
>> 
>> the app starts and the address bar remains unchanged.
>>
>> Thanks for you time.
>>
>>  
>> On Monday, August 28, 2017 at 2:40:07 PM UTC-4, Anthony wrote:
>>>
>>> First, get rid of routes_in/routes_out -- they will not work in 
>>> conjunction with "router".
>>>
>>> Regarding "default" in the URL -- how are you generating the URL. You 
>>> can always add default_controller="default", but that should not be 
>>> necessary, as "default" is the default value for default_controller anyway.
>>>
>>> Anthony
>>>
>>> On Monday, August 28, 2017 at 2:14:15 PM UTC-4, 98u...@gmail.com wrote:

 Big thank you! This works.

 One little detail emerged though. Now that  I replaced the pattern 
 router.py (having my line in routes_out as above) in my site root with the 
 parameter rewrite method my URL shows 'default':

 https://192.168.1.25:8000/stock 
 
 /default
 and I was aiming for:
 https://192.168.1.25:8000/stock 
 

 I added a line: controllers='DEFAULT' has no effect:

 routers = dict(
 stock=dict(
 controllers='DEFAULT',
 default_function='index',
 functions=dict( 
 default=['index', ...],
 showcase=['index', ...]
 )
 ),
 )

 Thanks for your time

 On Monday, August 28, 2017 at 11:19:09 AM UTC-4, Anthony wrote:
>
> On Monday, August 28, 2017 at 10:05:27 AM UTC-4, 98u...@gmail.com 
> wrote:
>>
>> No, the name 'index' withing 'showcase' is idle.
>>
>
> Then just use the parameter-based rewrite system with a configuration 
> like 

[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-28 Thread 98ujko9
I removed routes_in and routes_out. The routes.py file in the site's root 
looks like so:


routers = dict(
# base router
BASE=dict(
default_application='init',
),
stock=dict(
default_function='index',
functions=dict(
default=['index','call','download','user',],
showcase=['index',]
)
),
)


During development I launch the stock app from the administrative interface 
and the address bar shows:
https://192.168.1.25:8000/stock 

/default
During its running one  menu item STOCK (it serves as home button, 
beginning of listing) is visible, rendered by code:

response.menu_stock = [(T('Stock'), False, URL('stock','default','index'), 
[])
]
 upon clicking on it the address bar also shows:
https://192.168.1.25:8000/stock 

/default

I have two more apps in this site:

INIT- which is sort of like a facade for the website when you type the 
domain name in the browser it starts. 
I launch STOCK app from within INIT with the same menu construct as above. 
The browser also shows 'default'.

NOTES- which are instructions to myself and my customer.

I may add more apps in this project down the road.

Curious, when I launch the app through address bar by typing: 
https://192.168.1.25:8000/stock 

the app starts and the address bar remains unchanged.

Thanks for you time.

 
On Monday, August 28, 2017 at 2:40:07 PM UTC-4, Anthony wrote:
>
> First, get rid of routes_in/routes_out -- they will not work in 
> conjunction with "router".
>
> Regarding "default" in the URL -- how are you generating the URL. You can 
> always add default_controller="default", but that should not be necessary, 
> as "default" is the default value for default_controller anyway.
>
> Anthony
>
> On Monday, August 28, 2017 at 2:14:15 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> Big thank you! This works.
>>
>> One little detail emerged though. Now that  I replaced the pattern 
>> router.py (having my line in routes_out as above) in my site root with the 
>> parameter rewrite method my URL shows 'default':
>>
>> https://192.168.1.25:8000/stock 
>> 
>> /default
>> and I was aiming for:
>> https://192.168.1.25:8000/stock 
>> 
>>
>> I added a line: controllers='DEFAULT' has no effect:
>>
>> routers = dict(
>> stock=dict(
>> controllers='DEFAULT',
>> default_function='index',
>> functions=dict( 
>> default=['index', ...],
>> showcase=['index', ...]
>> )
>> ),
>> )
>>
>> Thanks for your time
>>
>> On Monday, August 28, 2017 at 11:19:09 AM UTC-4, Anthony wrote:
>>>
>>> On Monday, August 28, 2017 at 10:05:27 AM UTC-4, 98u...@gmail.com wrote:

 No, the name 'index' withing 'showcase' is idle.

>>>
>>> Then just use the parameter-based rewrite system with a configuration 
>>> like this:
>>>
>>> routers = dict(
>>> stock=dict(
>>> default_function='index',
>>> functions=dict(
>>> default=['index', ...],
>>> showcase=['index', ...]
>>> )
>>> ),
>>> )
>>>
>>> Then simply change the "asset" function to "index".
>>>
>>> Anthony
>>>
>>

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


[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-28 Thread 98ujko9
Big thank you! This works.

One little detail emerged though. Now that  I replaced the pattern 
router.py (having my line in routes_out as above) in my site root with the 
parameter rewrite method my URL shows 'default':

https://192.168.1.25:8000/stock 

/default
and I was aiming for:
https://192.168.1.25:8000/stock 


I added a line: controllers='DEFAULT'

routers = dict(
stock=dict(
controllers='DEFAULT',
default_function='index',
functions=dict( 
default=['index', ...],
showcase=['index', ...]
)
),
)

Thanks for your time

On Monday, August 28, 2017 at 11:19:09 AM UTC-4, Anthony wrote:
>
> On Monday, August 28, 2017 at 10:05:27 AM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> No, the name 'index' withing 'showcase' is idle.
>>
>
> Then just use the parameter-based rewrite system with a configuration like 
> this:
>
> routers = dict(
> stock=dict(
> default_function='index',
> functions=dict(
> default=['index', ...],
> showcase=['index', ...]
> )
> ),
> )
>
> Then simply change the "asset" function to "index".
>
> Anthony
>

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


[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-28 Thread 98ujko9
No, the name 'index' withing 'showcase' is idle.

On Monday, August 28, 2017 at 9:56:13 AM UTC-4, Anthony wrote:
>
> Do you have a /showcase/index function?
>
> On Monday, August 28, 2017 at 2:03:40 AM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> I chose pattern-based rewrite because I don't know better. I am temporary 
>> part time web coder relying on web2py book 100% with understanding at about 
>> 60%. Being a mature person I am fond of eloquence in life as well as in 
>> URL's however complexity has its price. I sense from what you are saying I 
>> should stick with parametric router or leave it alone and keep the "asset" 
>> function where it naturally is . A quick sketch of what I am having fun 
>> with (this is ongoing process):
>>
>>
>> 
>> Thanks in advance.
>>
>> On Sunday, August 27, 2017 at 7:55:27 PM UTC-4, Anthony wrote:
>>>
>>> Got it. Next time, please provide more detail regarding your current 
>>> code/setup. Is there any particular reason you need to be using the 
>>> pattern-based rewrite system? If so, you'll just need to create a regex 
>>> that matches the route in question, or create a regex that matches all the 
>>> other possible functions in the controller and create a fallback route 
>>> *after* that to direct to the "asset" function.
>>>
>>> Anthony
>>>
>>> On Sunday, August 27, 2017 at 1:33:09 PM UTC-4, 98u...@gmail.com wrote:

 I could make "asset" function the default for the "showcase" controller 
 however I am not sure how as I am already using renamed 
 routes.patterns.example.py (the book recommends not to mix pattern and 
 parameter routing methods) in the root of the website (multiple apps in my 
 case) to rewrite one URL (works nicely):

 routes_out = (
 ('/stock/default/index',BASE + '/stock'),# <== my addition
 # do not reroute admin unless you want to disable it
 ('/admin/$anything', BASE + '/admin/$anything'),
 # do not reroute appadmin unless you want to disable it
 ('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything'),
 # do not reroute static files
 ('/$app/static/$anything', BASE + '/$app/static/$anything'),
 # do other stuff
 (r'.*http://otherdomain\.com.* /app/ctr(?P.*)', r'\g'),
 (r'/app(?P.*)', r'\g'),
 # restore the BASE prefix
 ('/$anything', BASE + '/$anything'),
 )

 Thanks in advance for any assistance


 On Sunday, August 27, 2017 at 12:17:16 PM UTC-4, Anthony wrote:
>
> On Saturday, August 26, 2017 at 4:05:59 PM UTC-4, 98u...@gmail.com 
> wrote:
>>
>> How can I rewrite the URL (to drop asset):
>>
>> https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
>> to look like:
>>
>> https://192.168.1.25:8000/stock/showcase/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
>> the app 'stock' ins't default
>> the controllert 'showcase' isn't default
>> the function 'asset' isn't default
>>
>
> Do you use another function as the default within the "showcase" 
> controller? If not, you can define "asset" as the default function just 
> for 
> the "showcase" controller using the parameter-based router. 
> Alternatively, 
> you can use the default function to handle the above routes by checking 
> for 
> a URL arg and returning the appropriate response. For example, if the 
> default function is "index":
>
> def index():
> if not request.args:
> [code currently in the "index" function]
> else:
> [code currently in the "asset" function]
>
> Finally, you could use the pattern-based rewrite system, though that 
> can start to get complex.
>
> Anthony
>


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


[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-28 Thread 98ujko9


I chose pattern-based rewrite because I don't know better. I am temporary 
part time web coder relying on web2py book 100% with understanding at about 
60%. Being a mature person I am fond of eloquence in life as well as in 
URL's however complexity has its price. I sense from what you are saying I 
should stick with parametric router or leave it alone and keep the "asset" 
function where it naturally is . A quick sketch of what I am having fun 
with (this is ongoing process):


Thanks in advance.

On Sunday, August 27, 2017 at 7:55:27 PM UTC-4, Anthony wrote:
>
> Got it. Next, provide more detail regarding your current code/setup. Is 
> there any particular reason you need to be using the pattern-based rewrite 
> system? If so, you'll just need to create a regex that matches the route in 
> question, or create a regex that matches all the other possible functions 
> in the controller and create a fallback route *after* that to direct to 
> the "asset" function.
>
> Anthony
>
> On Sunday, August 27, 2017 at 1:33:09 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> I could make "asset" function the default for the "showcase" controller 
>> however I am not sure how as I am already using renamed 
>> routes.patterns.example.py (the book recommends not to mix pattern and 
>> parameter routing methods) in the root of the website (multiple apps in my 
>> case) to rewrite one URL (works nicely):
>>
>> routes_out = (
>> ('/stock/default/index',BASE + '/stock'),# <== my addition
>> # do not reroute admin unless you want to disable it
>> ('/admin/$anything', BASE + '/admin/$anything'),
>> # do not reroute appadmin unless you want to disable it
>> ('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything'),
>> # do not reroute static files
>> ('/$app/static/$anything', BASE + '/$app/static/$anything'),
>> # do other stuff
>> (r'.*http://otherdomain\.com.* /app/ctr(?P.*)', r'\g'),
>> (r'/app(?P.*)', r'\g'),
>> # restore the BASE prefix
>> ('/$anything', BASE + '/$anything'),
>> )
>>
>> Thanks in advance for any assistance
>>
>>
>> On Sunday, August 27, 2017 at 12:17:16 PM UTC-4, Anthony wrote:
>>>
>>> On Saturday, August 26, 2017 at 4:05:59 PM UTC-4, 98u...@gmail.com 
>>> wrote:

 How can I rewrite the URL (to drop asset):

 https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
 to look like:

 https://192.168.1.25:8000/stock/showcase/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
 the app 'stock' ins't default
 the controllert 'showcase' isn't default
 the function 'asset' isn't default

>>>
>>> Do you use another function as the default within the "showcase" 
>>> controller? If not, you can define "asset" as the default function just for 
>>> the "showcase" controller using the parameter-based router. Alternatively, 
>>> you can use the default function to handle the above routes by checking for 
>>> a URL arg and returning the appropriate response. For example, if the 
>>> default function is "index":
>>>
>>> def index():
>>> if not request.args:
>>> [code currently in the "index" function]
>>> else:
>>> [code currently in the "asset" function]
>>>
>>> Finally, you could use the pattern-based rewrite system, though that can 
>>> start to get complex.
>>>
>>> Anthony
>>>
>>

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


[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread 98ujko9
I chose pattern-based  rewrite because I don't know better. Please know 
that I am only temporary part time web coder relying on web2py book 100% 
with understanding at about 60%. Being a mature person I am fond of 
eloquence in life as well as in URL's however complexity has its price. I 
sense from what you are  saying I should stick with parametric router or 
leave it alone and keep the "asset" function where it naturally is .  A 
quick sketch of what I am having fun with:



Thanks in advance.

On Sunday, August 27, 2017 at 7:55:27 PM UTC-4, Anthony wrote:
>
> Got it. Next, provide more detail regarding your current code/setup. Is 
> there any particular reason you need to be using the pattern-based rewrite 
> system? If so, you'll just need to create a regex that matches the route in 
> question, or create a regex that matches all the other possible functions 
> in the controller and create a fallback route *after* that to direct to 
> the "asset" function.
>
> Anthony
>
> On Sunday, August 27, 2017 at 1:33:09 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> I could make "asset" function the default for the "showcase" controller 
>> however I am not sure how as I am already using renamed 
>> routes.patterns.example.py (the book recommends not to mix pattern and 
>> parameter routing methods) in the root of the website (multiple apps in my 
>> case) to rewrite one URL (works nicely):
>>
>> routes_out = (
>> ('/stock/default/index',BASE + '/stock'),# <== my addition
>> # do not reroute admin unless you want to disable it
>> ('/admin/$anything', BASE + '/admin/$anything'),
>> # do not reroute appadmin unless you want to disable it
>> ('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything'),
>> # do not reroute static files
>> ('/$app/static/$anything', BASE + '/$app/static/$anything'),
>> # do other stuff
>> (r'.*http://otherdomain\.com.* /app/ctr(?P.*)', r'\g'),
>> (r'/app(?P.*)', r'\g'),
>> # restore the BASE prefix
>> ('/$anything', BASE + '/$anything'),
>> )
>>
>> Thanks in advance for any assistance
>>
>>
>> On Sunday, August 27, 2017 at 12:17:16 PM UTC-4, Anthony wrote:
>>>
>>> On Saturday, August 26, 2017 at 4:05:59 PM UTC-4, 98u...@gmail.com 
>>> wrote:

 How can I rewrite the URL (to drop asset):

 https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
 to look like:

 https://192.168.1.25:8000/stock/showcase/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
 the app 'stock' ins't default
 the controllert 'showcase' isn't default
 the function 'asset' isn't default

>>>
>>> Do you use another function as the default within the "showcase" 
>>> controller? If not, you can define "asset" as the default function just for 
>>> the "showcase" controller using the parameter-based router. Alternatively, 
>>> you can use the default function to handle the above routes by checking for 
>>> a URL arg and returning the appropriate response. For example, if the 
>>> default function is "index":
>>>
>>> def index():
>>> if not request.args:
>>> [code currently in the "index" function]
>>> else:
>>> [code currently in the "asset" function]
>>>
>>> Finally, you could use the pattern-based rewrite system, though that can 
>>> start to get complex.
>>>
>>> Anthony
>>>
>>

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


[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread 98ujko9
I could make "asset" function the default for the "showcase" controller 
however I am not sure how as I am already using renamed 
routes.patterns.example.py in the root of the website (multiple apps) to 
rewrite one URL (works nicely):

routes_out = (
('/stock/default/index','/stock'),# <== my addition
# do not reroute admin unless you want to disable it
('/admin/$anything', BASE + '/admin/$anything'),
# do not reroute appadmin unless you want to disable it
('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything'),
# do not reroute static files
('/$app/static/$anything', BASE + '/$app/static/$anything'),
# do other stuff
(r'.*http://otherdomain\.com.* /app/ctr(?P.*)', r'\g'),
(r'/app(?P.*)', r'\g'),
# restore the BASE prefix
('/$anything', BASE + '/$anything'),
)

Thanks in advance for any assistance


On Sunday, August 27, 2017 at 12:17:16 PM UTC-4, Anthony wrote:
>
> On Saturday, August 26, 2017 at 4:05:59 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> How can I rewrite the URL (to drop asset):
>>
>> https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
>> to look like:
>>
>> https://192.168.1.25:8000/stock/showcase/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
>> the app 'stock' ins't default
>> the controllert 'showcase' isn't default
>> the function 'asset' isn't default
>>
>
> Do you use another function as the default within the "showcase" 
> controller? If not, you can define "asset" as the default function just for 
> the "showcase" controller using the parameter-based router. Alternatively, 
> you can use the default function to handle the above routes by checking for 
> a URL arg and returning the appropriate response. For example, if the 
> default function is "index":
>
> def index():
> if not request.args:
> [code currently in the "index" function]
> else:
> [code currently in the "asset" function]
>
> Finally, you could use the pattern-based rewrite system, though that can 
> start to get complex.
>
> Anthony
>

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


[web2py] how to rewrite an URL to drop a function name showing in the address bar

2017-08-26 Thread 98ujko9
How can I rewrite the URL (to drop asset):
https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
to look like:
https://192.168.1.25:8000/stock/showcase/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
the app 'stock' ins't default
the controllert 'showcase' isn't default
the function 'asset' isn't default
the '2017-Some-fridge' is args element and 
'id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1' is vars element

In my opinion the function name 'asset' in the url is redundant for search 
engine optimisation. Or am I mistaken?

Thanks in advance.

-- 
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] uuid field in CRUD call as record_id argument

2017-06-27 Thread 98ujko9
Hello,
I have not seen mention of this anywhere. Perhaps my question is 
a superfluous. If a table contains uuid field type can it be used as a 
record_id for an argument in CRUD update call.
It looks that it cannot.
Thanks

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


[web2py] Re: gae issue when using two independent apps with same data model under one project

2017-06-19 Thread 98ujko9
Thank you for your input. By creating a separate project the issue goes 
away. However it seems to me that in this way more resources are consumed. 
Such discussion would be beyond my competence level. Thanks

On Monday, June 19, 2017 at 8:29:14 AM UTC-4, Karoly Kantor wrote:
>
> You can definitely create a new project, that is sure to work.
>
> Otherwise, I am also somewhat confused with the nomenclature, so I asked 
> the question in the Google App Engine forum, you can follow any potential 
> explanations here:
>
>
> https://groups.google.com/forum/?fromgroups#!topic/google-appengine/UKfHKEOG7yc
>
>
>
> On Friday, June 16, 2017 at 5:11:34 PM UTC+2, 98u...@gmail.com wrote:
>>
>> Hello,
>> I uploaded a simple web2py app named 'mynotes', (based on markmin app 
>> example) to gae under a project 'projectnotes' to keep my notes in. Very 
>> simple model:
>> db.define_table('tblpage',
>> Field('page_title','string',label='Title'),
>> Field('page_text','text',label='Text'))
>> All works fine in gae.
>> Then I was working on a different app and I decided to keep notes in gea 
>> for it as well. So I created a new web2py app named 'mechnotes' based on 
>> 'mynotes' app. Everything the same except their names. I uploaded both apps 
>> to gae under the same project name: 'projectnotes'.
>> Here is the problem: the second app uses the table and the content of the 
>> first app! So I cannot create separate, independent notes in my second app.
>> Could the 'rname' parameter in the table definition be used to create 
>> application unique table names? 
>> Thank you in advance.
>>
>>

-- 
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] gae issue when using two independent apps with same data model under one project

2017-06-16 Thread 98ujko9
Hello,
I uploaded a simple web2py app named 'mynotes', (based on markmin app 
example) to gae under a project 'projectnotes' to keep my notes in. Very 
simple model:
db.define_table('tblpage',
Field('page_title','string',label='Title'),
Field('page_text','text',label='Text'))
All works fine in gae.
Then I was working on a different app and I decided to keep notes in gea 
for it as well. So I created a new web2py app named 'mechnotes' based on 
'mynotes' app. Everything the same except their names. I uploaded both apps 
to gae under the same project name: 'projectnotes'.
Here is the problem: the second app uses the table and the content of the 
first app! So I cannot create separate, independent notes in my second app.
Could the 'rname' parameter in the table definition be used to create 
application unique table names? 
Thank you in advance.

-- 
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: dev_appserver does not allow login to my web2py app from LAN client

2017-06-15 Thread 98ujko9
My mistake!
Please forgive me for wasting your time. I can't replicate that situation 
where I received above mentioned message. Suddenly I can do everything that 
I want.
Working with web2py is fun! 

On Thursday, June 15, 2017 at 12:21:11 AM UTC-4, Anthony wrote:
>
> It's still not clear what is generating the message you see. Can you show 
> the URL you are attempting to visit and exactly what you see on the page?
>
> Note, requiring login via @auth.requires_login() or @auth.requires() does 
> not require HTTPS or a "secure channel", so merely requiring login for 
> particular actions would not result in the message you are seeing.
>
> If you have request.requires_https() somewhere, you'll need to make it 
> conditional on the environment -- for example:
>
> if os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/'):
> request.requires_https() # Only when running on GAE.
>
> If that's the issue, though, it has nothing to do with requiring login.
>
> Anthony
>
> On Wednesday, June 14, 2017 at 7:30:53 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> Thank you for your response!
>>
>> I am afraid that my question lacked precision! Here is my regular command 
>> line to start web2py:
>> ~/src/w2app$ ./web2py.py --password='1' -c ../ssl-key-crt/server.crt 
>> -k ../ssl-key-crt/server.key --ip=192.168.1.25
>> It works very nice!
>>
>> Here is my command required by dev_appserver before you deploy to gae:
>> ~/src$ dev_appserver.py --host=192.168.1.25 w2app/
>>
>> My application requires that the user is logged in before any 
>> functionality is availabe. I am not talking admin app nor appadmin app. So 
>> when it is running in dev_appserver and I try to login I get a message 
>> something like: can't login because insecure channel. And I can't use any 
>> of its functionality. This is because I am not at the local host and this 
>> behavior is understood. The problem is that my linux box, where I run 
>> web2py server,  is 'headless', no windowing software, and I develop  my 
>> apps via ssh and a browser from a client, in this case a chromebook, and I 
>> can never be or appear to the system as being at the local host in this 
>> fashion.
>> Is there a linux configuration that would make me appear to the 
>> dev_appserver as being at the local host even though I am accessing it form 
>> LAN client?
>> Thank you in advance.
>>
>>- 
>>
>> On Wednesday, June 14, 2017 at 6:04:45 PM UTC-4, Anthony wrote:
>>>
>>> On Tuesday, June 13, 2017 at 1:12:44 PM UTC-4, 98u...@gmail.com wrote:

 I run my web2py on a home lan, headless box of linux. My web2py apps 
 require login and it can only be performed over a secure channel. My 
 question: is it possible (if yes then how) to configure my linux box to 
 simulate local host accessing so that I can remain sitting on my couch? 
 Should I remove all the decorators requiring user signature in my web2py 
 app and the run through the dev_appserver?

>>>
>>> The Auth decorators do not require an HTTPS connection. Are you talking 
>>> about trying to access either the admin app or the appadmin page of your 
>>> app -- those are the only things that require HTTPS (or alternatively a 
>>> local connection).
>>>
>>> Anthony
>>>
>>

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


[web2py] Re: dev_appserver does not allow login to my web2py app from LAN client

2017-06-14 Thread 98ujko9
Thank you for your response!

I am afraid that my question lacked precision! Here is my regular command 
line to start web2py:
~/src/w2app$ ./web2py.py --password='1' -c ../ssl-key-crt/server.crt -k 
../ssl-key-crt/server.key --ip=192.168.1.25
It works very nice!

Here is my command required by dev_appserver before you deploy to gae:
~/src$ dev_appserver.py --host=192.168.1.25 w2app/

My application requires that the user is logged in before any functionality 
is availabe. I am not talking admin app nor appadmin app. So when it is 
running in dev_appserver and I try to login I get a message something like: 
can't login because insecure channel. And I can't use any of its 
functionality. This is because I am not at the local host and this behavior 
is understood. The problem is that my linux box, where I run web2py server, 
 is 'headless', no windowing software, and I develop  my apps via ssh and a 
browser from a client, in this case a chromebook, and I can never be or 
appear to the system as being at the local host in this fashion.
Is there a linux configuration that would make me appear to the 
dev_appserver as being at the local host even though I am accessing it form 
LAN client?
Thank you in advance.

   - 
   
On Wednesday, June 14, 2017 at 6:04:45 PM UTC-4, Anthony wrote:
>
> On Tuesday, June 13, 2017 at 1:12:44 PM UTC-4, 98u...@gmail.com 
>  wrote:
>>
>> I run my web2py on a home lan, headless box of linux. My web2py apps 
>> require login and it can only be performed over a secure channel. My 
>> question: is it possible (if yes then how) to configure my linux box to 
>> simulate local host accessing so that I can remain sitting on my couch? 
>> Should I remove all the decorators requiring user signature in my web2py 
>> app and the run through the dev_appserver?
>>
>
> The Auth decorators do not require an HTTPS connection. Are you talking 
> about trying to access either the admin app or the appadmin page of your 
> app -- those are the only things that require HTTPS (or alternatively a 
> local connection).
>
> Anthony
>

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


[web2py] dev_appserver does not allow login to my web2py app from LAN client

2017-06-13 Thread 98ujko9
I run my web2py on a home lan, headless box of linux. My web2py apps 
require login and it can only be performed over a secure channel. My 
question: is it possible (if yes then how) to configure my linux box to 
simulate local host accessing so that I can remain sitting on my couch? 
Should I remove all the decorators requiring user signature in my web2py 
app and the run through the dev_appserver?
Thank you in advance!

-- 
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 2.10.3 si OUT

2015-04-03 Thread 98ujko9
It did help to delete the folder upon upgrading via browser. But I 
experience something odd now,  when I set-up web2py from the new source 
files (not via upgrade because that works) on Linux I cannot uninstall 
application that I have just created and also I cannot install external 
application using a browser I mean. My web2py folder is ownd by www-data. I 
can run however my  old application if I copy its folder to this new web2py 
(2.10.3) .

On Thursday, April 2, 2015 at 6:19:49 PM UTC-4, Massimo Di Pierro wrote:

 I posted a new version to address some minor issues. 

 If you upgrade from 2.9.11 or 2.9.12 the auto update may not work and you 
 have to delete the file:

 web2py/gluon/dal




-- 
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: smartgrid form submit button behaviour

2014-09-02 Thread 98ujko9
Well, drop down is too tight when you have lots of rows and also in the 
window I have the functionality of the browser search tool.
I filed an issue about my dilemma: 
https://code.google.com/p/web2py/issues/detail?id=1974start=100;


On Tuesday, September 2, 2014 6:12:12 PM UTC-4, Cliff Kachinske wrote:

 Why not use a drop down field?

-- 
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] smartgrid form submit button behaviour

2014-08-30 Thread 98ujko9
1) smartgrid produces a form for a new record
2) I click on an input field and with the help of javascript smaller 
(second) browser window opens with related table content
3) I select a row in the window and ID is inserted in the first window 
field, the smaller second window closes.
4) I click submit in  the first window and the form inserts new record 
howerver
5 PROBLEM: page is redirected to the URL of the second window, that just 
closed (unwanted behaviour) not where the smartgrid was initially 
6 if I do not evoke the second window (where i select a record id) the 
submit action is all-right.
Why is the URL of the submit action being changed and what is a possible 
solution?
Thanks

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


[web2py] grid orderby parameter not quite useful for a foreign key column

2014-07-05 Thread 98ujko9
The grid below orders the rows by part_description column only the first 
time the action is called. After that if you click on the header link it 
orders by pp_part_id foreign 
key which is not as useful as it could be by part_description.
Why the link in the header for that column does not receive the orderby 
argument passed to the grid?
Any help or explanation will be appreciated, thanks.
 
fields = [db.partprice.pp_id,
  db.partprice.pp_part_id,
  db.partprice.pp_partnum,
  db.partprice.pp_supp_id,
  db.partprice.pp_unit_price,
  db.partprice.pp_sugg_price,
  db.partprice.pp_intro_date,
  db.partprice.pp_term_date,
  db.partprice.pp_term_id,
  db.partprice.pp_comment
  ]
headers= {'partprice.pp_id':'Price Id',
  'partprice.pp_part_id':'Part',
  'partprice.pp_partnum':'Part Number',
  'partprice.pp_supp_id':'Supplier',
  'partprice.pp_unit_price':'Unit',
  'partprice.pp_sugg_price':'Suggested',
  'partprice.pp_intro_date':'Introduced',
  'partprice.pp_term_date':'Terminated',
  'partprice.pp_term_id':'Termination ID',
  'partprice.pp_comment':'Comment'
  }

db.define_table('part',
Field('part_id','id'),

Field('part_description','string',length=128,label='Description'),
Field('part_intro_date','date',default = 
now,label='Introduced'),
Field('part_term_date','date',label='Terminated'),
Field('part_term_id','integer',default=0,label='Termination 
ID'),
Field('part_comment','string',label='Comment'),
migrate='part.table', format='%(part_description)s'
)
db.define_table('partprice',
Field('pp_id','id',label='Price Id'),
Field('pp_part_id','reference part',label='Part'),
Field('pp_partnum','string',length =50,label='Number'),
Field('pp_supp_id','reference supplier',label='Supplier'),

Field('pp_unit_price','decimal(18,2)',default=0.00,label='Unit'),

Field('pp_sugg_price','decimal(18,2)',default=0.00,label='Suggested'),

Field('pp_intro_date','date',default=now,label='Introduced'),
Field('pp_term_date','date',label='Terminated'),
Field('pp_term_id','integer',default=0,label='Termination 
ID'),
Field('pp_comment','string',label='Comment'),
migrate=False, format='%(pp_part_id)s'
)

left=db.partprice.on(db.part.part_id==db.partprice.pp_part_id)
orderby=[db.part.part_description]
form=SQLFORM.grid(db.partprice,left=left,fields=fields,headers=headers,orderby=orderby,sortable=True,paginate='all')

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


[web2py] Re: Readonly elements (select and date field) respond to clicks, allow for changes and can be submitted?

2014-06-23 Thread 98ujko9
I did what you suggested but the calls to:

db.owner.own_end_date.writable = False # not writable
db.owner.own_end_date.readable = False # do not show is at all!

are effective only if executed before the call to form = 
SQLFORM.smartgrid(db.owner, ...
When executed after, have no effect.
I want to make db.owner.own_end_date not writeable conditionally:
   ...
   ...
   if ((len(request.args)1) and (request.args(1)=='edit')):
if (form.element('input',_name='own_end_date')['_value']!=''):
db.owner.own_end_date.writable=False # - no effect
...
...

If the edited record contains a date value in that field then user must not 
change it. How can I make that field not writeable in such a case?
Thanks

On Monday, June 23, 2014 1:00:05 AM UTC-4, 98u...@gmail.com wrote:

 Why readonly elements (select and date field) of a form respond to clicks 
 and allow for changes and can be submitted? They look grayed out as if 
 readonly but when I click on date field the date picker appears and works 
 as it shoud also the select option is grayed out but it offers a list to 
 choose an option and the form can be submitted with these changed values 
 even though this is not intended.
 #this is the model

 db.define_table('owner',
 Field('own_cust_fk','reference customer',label='Customer'),
 Field('own_veh_fk','reference vehicle',label='Vehicle'),
 Field('own_plate','string',label='Plate'),
 Field('own_comment','string',label='Comment'),
 Field('own_start_date','date',default=now,label='Start 
 date'),
 
 Field('own_end_date','date',default=None,label='Terminated'),
 migrate='owner.table',format='%(own_plate)s 
 %(own_cust_fk)s',
 plural='Owner'
 )


 def index():

 ...
 ...

 form = SQLFORM.smartgrid(db.owner,
  fields=fields,
  headers=headers,
  paginate=all,
  details=True,
  editable=True,
  deletable=False,
  create=False,
  showbuttontext=False,
  maxtextlength=40,
  maxtextlengths=maxtextlengths,
  buttons_placement = 'left',
  )
 ...
 ...

 if ((len(request.args)1) and (request.args(1)=='edit')):
 form.element('select',_name='own_cust_fk')['_readonly']='True'
 form.element('input',_name='own_end_date')['_readonly']='True'
 ...
 ...
 return dict(form=form)



 Any help would be appreciated!
 Thanks


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


[web2py] Readonly elements (select and date field) respond to clicks, allow for changes and can be submitted?

2014-06-22 Thread 98ujko9
Why readonly elements (select and date field) of a form respond to clicks 
and allow for changes and can be submitted? They look grayed out as if 
readonly but when I click on date field the date picker appears and works 
as it shoud also the select option is grayed out but it offers a list to 
choose an option and the form can be submitted with these changed values 
even though this is not intended.
#this is the model

db.define_table('owner',
Field('own_cust_fk','reference customer',label='Customer'),
Field('own_veh_fk','reference vehicle',label='Vehicle'),
Field('own_plate','string',label='Plate'),
Field('own_comment','string',label='Comment'),
Field('own_start_date','date',default=now,label='Start 
date'),

Field('own_end_date','date',default=None,label='Terminated'),
migrate='owner.table',format='%(own_plate)s 
%(own_cust_fk)s',
plural='Owner'
)


def index():

...
...

form = SQLFORM.smartgrid(db.owner,
 fields=fields,
 headers=headers,
 paginate=all,
 details=True,
 editable=True,
 deletable=False,
 create=False,
 showbuttontext=False,
 maxtextlength=40,
 maxtextlengths=maxtextlengths,
 buttons_placement = 'left',
 )
...
...

if ((len(request.args)1) and (request.args(1)=='edit')):
form.element('select',_name='own_cust_fk')['_readonly']='True'
form.element('input',_name='own_end_date')['_readonly']='True'
...
...
return dict(form=form)



Any help would be appreciated!
Thanks

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


[web2py] validator - asking it to do some more

2014-06-15 Thread 98ujko9
# table definition
db.define_table('vehicle',
Field('manufacturer','string'),
Field('name','string'),
Field('vin','string',length=32,unique=True),
Field('year','string'),
Field('colour','string'),
Field('comment','string'),
Field('date','date',default=now),
migrate='vehicle.table',format='%(manufacturer)s %(name)s 
%(year)s %(vin)s'
)

# present validator
db.vehicle.vin.requires=[IS_UPPER(), 
IS_NOT_IN_DB(db(db.vehicle.vin==request.vars.vin),db.vehicle.vin)]

# I have js function: validate_vin(VIN_NUMBER) that returns True or False

# If I had a form variable vinOK I could assign test result to it: 
jQuery(#vinOK).val(validate_vin(jQuery(#vehicle_vin).val()))

# then use the enhanced validator
# this is only hypothetical because the form has no variable vinOK but it 
would be desirable because I could use the functionality of the validator 
to show error in the form

db.vehicle.vin.requires=[IS_EXPR(('True == %s' % 
str(request.vars.vinOK)),error_message=VIN not good),IS_UPPER(), 
IS_NOT_IN_DB(db(db.vehicle.vin==request.vars.vin),db.vehicle.vin)]

# A hidden field would be a solution to store the result of the js function 
but hidden fields don't seem to work in web2py for security reasons.( That 
is my understanding)
# Any solution would be OK as long as I can use validator's functionality 
to show error message. Perhaps I do not need the hidden variable at all. 
How do I pass VIN test result to the validator? Thanks a lot in advance.

-- 
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: requires IS_IN_DB set as a union of two queries

2014-06-01 Thread 98ujko9
Resolved!

This is the sql string needed to produce a selection for my reference field 
in IS_IN_DB:

select vehicle.id,vehicle.manufacturer,vehicle.name,UPPER(vin) as vin from 
vehicle inner join (select a.own_veh_fk from owner a where a.own_end_date 
is not null and a.own_veh_fk not in (select b.own_veh_fk from owner b where 
b.own_end_date is null)) c  on vehicle.id=c.own_veh_fk union select 
vehicle.id,vehicle.manufacturer,vehicle.name,UPPER(vin) as vin  from 
vehicle left join owner on vehicle.id=own_veh_fk where own_veh_fk is null;

This is converted version to web2py:

q3=(db.vehicle.id==db.owner.own_veh_fk)(db.owner.own_end_date!=None)(~db.owner.own_veh_fk.belongs(db(db.owner.own_end_date==None)._select(db.owner.own_veh_fk)))
q4=~db.vehicle.id.belongs(db(db.owner.own_veh_fk0)._select(db.owner.own_veh_fk,left=db.vehicle.on((db.vehicle.id==None

db.owner.own_veh_fk.requires=IS_IN_DB(db(q3|q4),'vehicle.id', ' %(name)s 
%(vin)s',distinct=True)

Gee it works!
Just being on this forum helped. Thanks.
There are probably still other ways of doing it! More efficient butthis 
is only my passtime.


On Wednesday, May 28, 2014 7:47:36 PM UTC-4, 98u...@gmail.com wrote:

 Thank you Mr. Massimo and your colleagues for bringing the web2py to the 
 masses. 
 I need to have a field that will present a choice of values that result 
 from a union of query1 and query2
 How can i create a set that would go where the question mark is? Thanks 
 for any help!

 query1=((db.vehicle.id
 ==db.owner.own_veh_fk)(db.owner.own_end_date!=None))

 query2=(~db.vehicle.id.belongs(db(db.owner.own_veh_fk==db.vehicle.id
 )._select(db.vehicle.id)))

 db.owner.own_veh_fk.requires=IS_IN_DB((db(?)),'vehicle.id', 
 '%(manufacturer)s %(vin)s')



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


Re: [web2py] Re: requires IS_IN_DB set as a union of two queries

2014-05-30 Thread 98ujko9
This is my short version of SQL string that I am trying to convert for use 
with web2py. I am studding how to do it at this time but any help that 
comes sooner will be appreciated. It finds a vehicle without owner that is 
used when creating a vehicle owner.
select vehicle.id,vehicle.manufacturer,vehicle.name,UPPER(vin) as vin from 
vehicle inner join (select a.own_veh_fk from owner a where a.own_end_date 
is not null and a.own_veh_fk not in (select b.own_veh_fk from owner b where 
b.own_end_date is null)) c on vehicle.id=c.own_veh_fk union select 
vehicle.id,vehicle.manufacturer,vehicle.name,UPPER(vin) as vin from vehicle 
left join owner on vehicle.id=own_veh_fk where own_veh_fk is null;

On Thursday, May 29, 2014 7:53:34 AM UTC-4, yamandu wrote:

 Sorry, I should have written:

 db.owner.own_veh_fk.requires=IS_IN_DB(db(query),'vehicle.id', 
 '%(manufacturer)s %(vin)s')

 If you need to pass a set so you need to call db(query) in order to 
 execute the query.



 2014-05-28 21:46 GMT-03:00 98u...@gmail.com javascript::

 I did try:
 query =  query1 | guery2
 and received error: Set | Set or similar


 On Wednesday, May 28, 2014 7:47:36 PM UTC-4, 98u...@gmail.com wrote:

 Thank you Mr. Massimo and your colleagues for bringing the web2py to the 
 masses. 
 I need to have a field that will present a choice of values that result 
 from a union of query1 and query2
 How can i create a set that would go where the question mark is? Thanks 
 for any help!

 query1=((db.vehicle.id==db.owner.own_veh_fk)(db.owner.
 own_end_date!=None))

 query2=(~db.vehicle.id.belongs(db(db.owner.own_veh_fk==db.vehicle.id
 )._select(db.vehicle.id)))

 db.owner.own_veh_fk.requires=IS_IN_DB((db(?)),'vehicle.id', 
 '%(manufacturer)s %(vin)s')

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




 -- 
 Att.

 Carlos J. Costa
 Cientista da Computação
 Esp. Gestão em Telecom

 EL MELECH NEEMAN!
 אָמֵן

 

-- 
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] requires IS_IN_DB set as a union of two queries

2014-05-28 Thread 98ujko9
Thank you Mr. Massimo and your colleagues for bringing the web2py to the 
masses. 
I need to have a field that will present a choice of values that result 
from a union of query1 and query2
How can i create a set that would go where the question mark is? Thanks for 
any help!

query1=((db.vehicle.id==db.owner.own_veh_fk)(db.owner.own_end_date!=None))

query2=(~db.vehicle.id.belongs(db(db.owner.own_veh_fk==db.vehicle.id)._select(db.vehicle.id)))

db.owner.own_veh_fk.requires=IS_IN_DB((db(?)),'vehicle.id', 
'%(manufacturer)s %(vin)s')

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


[web2py] Re: requires IS_IN_DB set as a union of two queries

2014-05-28 Thread 98ujko9
I did try:
query =  query1 | guery2
and received error: Set | Set or similar

On Wednesday, May 28, 2014 7:47:36 PM UTC-4, 98u...@gmail.com wrote:

 Thank you Mr. Massimo and your colleagues for bringing the web2py to the 
 masses. 
 I need to have a field that will present a choice of values that result 
 from a union of query1 and query2
 How can i create a set that would go where the question mark is? Thanks 
 for any help!

 query1=((db.vehicle.id
 ==db.owner.own_veh_fk)(db.owner.own_end_date!=None))

 query2=(~db.vehicle.id.belongs(db(db.owner.own_veh_fk==db.vehicle.id
 )._select(db.vehicle.id)))

 db.owner.own_veh_fk.requires=IS_IN_DB((db(?)),'vehicle.id', 
 '%(manufacturer)s %(vin)s')



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


[web2py] Re: module-new file - error when saving

2013-12-02 Thread 98ujko9
Found the problem, it is my ignorance. Names that start with digits aren't 
valid identifiers. Thanks. I am new to all this.

On Monday, December 2, 2013 8:03:43 PM UTC-5, 黄祥 wrote:

 not sure why it's not work, please try to rename your modules files into 
 friendly name. e.g. rental_master.py

 then from your controller
 import rental_master
 def customer():
 return rental_master.grid_0(db.customer)


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


[web2py] module-new file - error when saving

2013-12-01 Thread 98ujko9
I am wondering if anyone else experience similar issue:
I create a new application, create a new module 123test.py file and when 
saving it get the error:

failed to reload module because: invalid syntax (string, line 1)

The content of the file at this point is:
#!/usr/bin/env python
# coding: utf8 
from gluon import *

I recently updated to:
web2py 2.8.2-stable+timestamp.2013.11.28.13.54.07 (Running on Apache/2.2.22 
(Debian), Python 2.7.3)

Thank you in advance for any assistance.


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


[web2py] Re: built-in wiki

2013-10-29 Thread 98ujko9
Thanks for reporting the issue.

On Tuesday, October 29, 2013 3:38:04 PM UTC-4, Alan Etkin wrote:

  

 Note: The current markmin render engine requires a first line-break for 
 multi-line code, otherwise it renders as single line. Try adding a leading 
 line-break in the text box.


 Nevermind that.

 http://code.google.com/p/web2py/issues/detail?id=1746 


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


[web2py] web2py markmin function does not render plus ( + ) charcter

2013-10-28 Thread 98ujko9
I am afraid that expression $$ x + y $$ will render as xy rather than 
x+y. I tried escaping the plus character but without any luck. I was 
wondering if somebody else encountered such an issue.
Any help will be much appreciated. Thanks

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


[web2py] built-in wiki

2013-10-27 Thread 98ujko9
Hello,
I am new to web programming. I use web2py built-in wiki: auth.wiki(), the 
simplest form. Why is it that when I click the preview button the style for 
markmin items like ``this is some code`` looks OK (code is highlighted, 
break lines are present) and when I click on submit a record I see a page 
where code text is in a different style (in red color and there is no line 
breaks). My version of web2py: 2.7.4-stable+timestamp.2013.10.14.15.16.29
Any help will be appreciated. Thanks

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