[web2py] DAL's fake_migrat and fake_migrate_all and migration problem with auth tables

2019-01-04 Thread icodk
First both fake_migrate and fake_migrate_all  are part of the DAL signature 
in the book,  However fake_migrate is only explained when it is used in a 
table definition, not in DAL.


Second issue that might be related:
I try to move web2py application to another server, including a pg database 
in the following order:
1. took a backup of the database on the old server
2. restored the database on the new server
3. Copy the web2py application to the new server include the databases files
4. my first attempt to run the app resulted in  error: relation "auth_user" 
already exists
6. I verified that a file  
 63e111e1d2096351b383c8ebce6b217f_auth_user.table EXIST so why the error?
7. Deleted the auth_user table from the database and file 
63e111e1d2096351b383c8ebce6b217f_auth_user.table
8. a new table was created and a new auth_user.table file but with another 
hex prefix: c8b669d15150d7109e5f7ab36744a5b7_auth_user.table
9. But now I got the same error on auth_group.
10.I solved it by just changing all the files with the old hex prefix to 
the new prefix and everything was working.
There are only hex prefix to the auth tables because I Can't/didn't set the 
migrate table settings 

I also attempted to use the fake_migrate_all=True ,migrate=False but none 
of the auth files was created. Only my own tables files
1. deleted all the databases folder files and set DAL's  
fake_migrate_all=True ,migrate=False
2. Only my tables files (in databases folder), and scheduler files (with 
the new hex prefix) was created.

Why not all tables files was created on fake migration?
Why the auth tables migration file names  need a hex prefix and  why it is 
different for each web2py installation ?
If the hex prefix can be changed and everything is working ? why need it in 
the first place ?
Shouldn't  a complete copy of application and database just work out of the 
box ?

(2.17.1-stable+timestamp.2018.08.05.17.57.00
(Running on nginx/1.12.1, Python 2.7.14)

-- 
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: Customizing detail view (grid)

2019-01-04 Thread 黄祥
perhaps you can use conditional to check request.args value
*e.g.*
if 'view' in request.args:
do_whatever_you_want

best regards,
stifan

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


Re: [web2py] Re: private functions

2019-01-04 Thread Eliezer (Vlad) Tseytkin
It's very clear,
Thank you!

On Fri, Jan 4, 2019, 4:07 PM Dave S 
>
> On Thursday, January 3, 2019 at 8:51:30 PM UTC-8, Anthony wrote:
>>
>> On Thursday, January 3, 2019 at 11:32:27 PM UTC-5, Vlad wrote:
>> > Here is a quote from THE BOOK: "Functions that take arguments or start
>> with a double underscore are not publicly exposed and can only be called by
>> other functions."
>> >
>> >
>> > What about functions that take an argument which has a default value
>> specified (i.e. can be called without an argument)? Would that be private
>> or public?
>>
>> That's still private. It is based on the function definition, not the way
>> it is called.
>>
>
> And the book has an example at
>  http://web2py.com/books/default/chapter/29/13/deployment-recipes#Initial-Queuing-of-a-Repeating-Task
> >
>
> /dps
>
>
>>
>> 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.
>

-- 
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: private functions

2019-01-04 Thread Dave S


On Thursday, January 3, 2019 at 8:51:30 PM UTC-8, Anthony wrote:
>
> On Thursday, January 3, 2019 at 11:32:27 PM UTC-5, Vlad wrote: 
> > Here is a quote from THE BOOK: "Functions that take arguments or start 
> with a double underscore are not publicly exposed and can only be called by 
> other functions." 
> > 
> > 
> > What about functions that take an argument which has a default value 
> specified (i.e. can be called without an argument)? Would that be private 
> or public?  
>
> That's still private. It is based on the function definition, not the way 
> it is called. 
>

And the book has an example at
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Initial-Queuing-of-a-Repeating-Task>

/dps
 

>
> 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] Customizing detail view (grid)

2019-01-04 Thread Vlad
How would I customize a details view which is brought up by the grid when 
"view/detail" button is clicked when the grid has "details=True" parameter 
set?
(I just want to add more information there, but not straight from the table 
the grid is based on)

-- 
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] can access web2py app even if it's disabled

2019-01-04 Thread Shawn Michaels
Hi,

I just noticed, I can access disabled app.

when I connect from local network with /etc/hosts file edited like this:
[server IP] [disabled.address]

The page:
Temporarily down for maintenance
is displayed

When I comment the hosts line out I can connect to disabled site.
Do anybody know why or is it something known?

I have defined base router for the disabled and second non-disabled app:
# -*- coding: utf-8 -*-

routers = dict(

# base router
BASE=dict(
default_application='app',
domains = {
"[address]" : "app",
"[disabled.address]" : "disabled_app",
},
),
)

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