[web2py] Database migration problem

2015-06-05 Thread Julien Courteau
Hello,

(1) I use sqlite

(2) In development I made the following change to a given table:
db.define_table(...
Field('description', 'text'),
...
) 
becomes:
db.define_table(...
Field('description_en', 'text'),
Field('description_fr', 'text'),
...
) 
Everything went well.

(3) Then I tried to apply the same changes to the production database and 
it gave me the
error: "column description_en does not exist" when the application try to 
access the table.
The migration did not occur. The database still has only the description 
field in it.

(4) I tried to get rid of the table files (migration files from the 
databases folder) related to that table
without success ("table does not exist")

(5) I tried to get rid of my changes in the models file and use:
db_es = DAL('sqlite://estore.db', fake_migrate_all=True) and then
reapply my changes with db_es = DAL('sqlite://estore.db', migrate=True)
with the same error ("description_en does not exist")

Please, how could I solve that problem?

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.


Re: [web2py] Unable to acces admin app in production

2014-01-28 Thread Julien Courteau
Yes I did a backup before.

I updated from 2.3 to 2.8.2. The only way I found to
get the admin work again is to remove the
web2py folder before unzipping the new version. 
I had the same problem with my local version.

I'll take a look to your post...

Thanks.

On Monday, January 27, 2014 8:46:59 PM UTC-5, Richard wrote:
>
> Did you backup before?
>
> You probably need to update a couple of file that are web2py specific in 
> static/ all the js, in views/ the generic views and the web2py_ajax also in 
> you case the appadmin.py controller must be update...
>
> You migrate from which version...
>
> If you search the list there is a post from me about all the app files 
> that should be update on web2py update...
>
> Richard
>
>
> On Fri, Jan 24, 2014 at 8:48 PM, Julien Courteau 
> 
> > wrote:
>
>> After I tried to upgrade to version 2.8.2-stable 2013.11.23 13.54.07 from 
>> the admin application (the upgrade button), I no longer have access
>> to the admin app: the ticket produced refer to an "import error" 
>> concerning gluon.tools.Config from the admin/default.py controller.
>> I tried to upgrade "manually" with the same result. The site is till 
>> accessible as usual.
>> Any clue?
>> Thanks.
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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] Unable to acces admin app in production

2014-01-24 Thread Julien Courteau
After I tried to upgrade to version 2.8.2-stable 2013.11.23 13.54.07 from 
the admin application (the upgrade button), I no longer have access
to the admin app: the ticket produced refer to an "import error" concerning 
gluon.tools.Config from the admin/default.py controller.
I tried to upgrade "manually" with the same result. The site is till 
accessible as usual.
Any clue?
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] Re: Unable to create Auth tables

2013-11-26 Thread Julien Courteau
It works! Thanks a lot Anthony!

On Monday, November 25, 2013 9:34:18 PM UTC-5, Anthony wrote:
>
> web2py thinks it already created those tables (you dropped them outside of 
> web2py, so it doesn't know they're gone). Try removing the associate 
> *.table files in the /databases folder (they store the migration 
> information for each table).
>
> Anthony
>
> On Monday, November 25, 2013 9:22:58 PM UTC-5, Julien Courteau wrote:
>>
>> (a) I did: drop table ;  == ["auth_user", 
>> "auth_group", etc...] in a sqlite3 shell;
>>
>> (b) I refresh my index page: web2py execute the auth.define_table() 
>> silently but no tables had been
>> created (sql.log contains no create table). I tried to figure out what's 
>> happening without success.
>> It did the same if I create a fresh new app. I use web2py 2.5.1. Any 
>> clues? How Could I do to figure 
>> out the problem?
>> 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] Unable to create Auth tables

2013-11-25 Thread Julien Courteau
(a) I did: drop table ;  == ["auth_user", 
"auth_group", etc...] in a sqlite3 shell;

(b) I refresh my index page: web2py execute the auth.define_table() 
silently but no tables had been
created (sql.log contains no create table). I tried to figure out what's 
happening without success.
It did the same if I create a fresh new app. I use web2py 2.5.1. Any clues? 
How Could I do to figure 
out the problem?
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] Re: @auth.requires_login() does not work and how to debug gluon modules?

2013-11-25 Thread Julien Courteau
Concerning the code tracing of web2py modules: it was my fault, I used a 
compiled version of my app. Sorry, for that.

I tried to recreate the auth tables (drop  and 
auth.define_tables()) but it didn't work: the commit()
seems to work well (migrate=True) but no tables had been created...


On Sunday, November 24, 2013 11:52:46 PM UTC-5, Julien Courteau wrote:
>
> Environment: web2py 2.3.2, ubuntu 13.10, firefox / chrome
>
> From a new app @auth.requires_login() works fine. 
> But with my current application the requires_login redirect me silently to 
> my default/index page without presenting me the login page. I tried to set 
> breakpoints (using pdb or dbg) into the gluon/tools.py module to diagnose 
> the problem without success . For this application the access control 
> mecanism stopped working after a web2py updates (I don't recall which one). 
> Could you please give me some advices on how to proceed in order to solve 
> this problem?
> 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] @auth.requires_login() does not work and how to debug gluon modules?

2013-11-24 Thread Julien Courteau
Environment: web2py 2.3.2, ubuntu 13.10, firefox / chrome

>From a new app @auth.requires_login() works fine. 
But with my current application the requires_login redirect me silently to 
my default/index page without presenting me the login page. I tried to set 
breakpoints (using pdb or dbg) into the gluon/tools.py module to diagnose 
the problem without success . For this application the access control 
mecanism stopped working after a web2py updates (I don't recall which one). 
Could you please give me some advices on how to proceed in order to solve 
this problem?
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] Passing parameters to web2py using apache/mod_wsgi

2013-03-13 Thread Julien Courteau
How to pass command line parameters to web2py (such as -K) 
when using apache and mod_wsgi. 

-- 

--- 
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: The book updates and status

2012-12-20 Thread Julien Courteau
I'm in for proof reading of the 5th edition.

-- 





[web2py] Re: New error after installing 2.2.1 version

2012-11-14 Thread Julien Courteau
Hello Massimo!

I send you the complete traceback (see the attach file).

Thanks a lot for web2py and your kindness for taking the time to look at 
that strange problem!

-- 




web2py™ administrative interface

Site
Edit
About
Errors
Versioning
Logout
Debug
Help

Error ticket for "mm"
Ticket ID

127.0.0.1.2012-11-14.19-52-34.bbc92967-4c0f-4038-8129-5e4e912b404f
 format requires a mapping
Version
web2py™ (2, 2, 1, datetime.datetime(2012, 10, 21, 16, 57, 4), 'stable')
Python  Python 2.7.3: /usr/bin/python
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.



Traceback (most recent call last):
  File "/home/julien/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/home/julien/web2py/applications/mm/controllers/default.py", line 291, 
in 
  File "/home/julien/web2py/gluon/globals.py", line 188, in 
self._caller = lambda f: f()
  File "/home/julien/web2py/applications/mm/controllers/default.py", line 210, 
in user
return dict(form=auth())
  File "/home/julien/web2py/gluon/tools.py", line 1235, in __call__
return getattr(self, args[0])()
  File "/home/julien/web2py/gluon/tools.py", line 2095, in login
self.log_event(log, user)
  File "/home/julien/web2py/gluon/tools.py", line 1692, in log_event
origin=origin, user_id=user_id)
  File "/home/julien/web2py/gluon/dal.py", line 7806, in insert
ret =  self._db._adapter.insert(self,self._listify(fields))
  File "/home/julien/web2py/gluon/dal.py", line 1155, in insert
query = self._insert(table,fields)
  File "/home/julien/web2py/gluon/dal.py", line 1151, in _insert
values = ','.join(self.expand(v,f.type) for f,v in fields)
  File "/home/julien/web2py/gluon/dal.py", line 1151, in 
values = ','.join(self.expand(v,f.type) for f,v in fields)
  File "/home/julien/web2py/gluon/dal.py", line 1306, in expand
return str(self.represent(expression,field_type))
  File "/home/julien/web2py/gluon/dal.py", line 1720, in represent
if obj == '' and not fieldtype[:2] in ['st', 'te', 'pa', 'up']:
  File "/home/julien/web2py/gluon/languages.py", line 363, in __eq__
return str(self) == str(other)
  File "/home/julien/web2py/gluon/languages.py", line 360, in __str__
self.T.translate(self.m, self.s))
  File "/home/julien/web2py/gluon/languages.py", line 878, in translate
message = self.params_substitution(message, symbols)
  File "/home/julien/web2py/gluon/languages.py", line 855, in 
params_substitution
message = message % symbols
TypeError: format requires a mapping

Error snapshot help

(format requires a mapping)

inspect attributes
Frames

File /home/julien/web2py/gluon/restricted.py in restricted at line 212 code 
arguments variables

File /home/julien/web2py/applications/mm/controllers/default.py in  
at line 291 code arguments variables

File /home/julien/web2py/gluon/globals.py in  at line 188 code 
arguments variables

File /home/julien/web2py/applications/mm/controllers/default.py in user at 
line 210 code arguments variables

File /home/julien/web2py/gluon/tools.py in __call__ at line 1235 code 
arguments variables

File /home/julien/web2py/gluon/tools.py in login at line 2095 code 
arguments variables

File /home/julien/web2py/gluon/tools.py in log_event at line 1692 code 
arguments variables

File /home/julien/web2py/gluon/dal.py in insert at line 7806 code arguments 
variables

File /home/julien/web2py/gluon/dal.py in insert at line 1155 code arguments 
variables

File /home/julien/web2py/gluon/dal.py in _insert at line 1151 code 
arguments variables

File /home/julien/web2py/gluon/dal.py in  at line 1151 code 
arguments variables

File /home/julien/web2py/gluon/dal.py in expand at line 1306 code arguments 
variables

File /home/julien/web2py/gluon/dal.py in represent at line 1720 code 
arguments variables

File /home/julien/web2py/gluon/languages.py in __eq__ at line 363 code 
arguments variables

File /home/julien/web2py/gluon/languages.py in __str__ at line 360 code 
arguments variables

File /home/julien/web2py/gluon/languages.py in translate at line 878 code 
arguments variables

File /home/julien/web2py/gluon/languages.py in params_substitution at line 
855 code arguments variables
Function argument list

(self=, message='User %(id)s Logged-in', 
symbols=("",))
Code listing

850.
851.
852.
853.
854.
855.

856.
857.
858.
859.



if part == s:
part = regex_plural_dict.sub(sub_dict, s)
if part == s:
return m.group(0)
return part
message = message % symbols

message = regex_plural.sub(sub_plural, message)
return message

def translate(self, message, symbols):

Variables

[web2py] New error after installing 2.2.1 version

2012-11-12 Thread Julien Courteau
Hello All,
After converting to 2.2.1 I've got the following error message:
" format requires a mapping"

when I try to log on for accessing an action that requires authentification 
/ authaurization such as:
@auth.requires_membership('admin')
def  f(): ...

Here is an extract of the traceback:


*File /home/julien/web2py/gluon/languages.py inparams_substitution 
at line 
855* 
Function argument list

(self=, 
message='User %(id)s Logged-in', symbols=("",))
Code listing 

850.
851.
852.
853.
854.
855.

856.
857.
858.
859.

if part == s:
part = regex_plural_dict.sub(sub_dict, s)
if part == s:
return m.group(0)
return part
message = message % symbols

message = regex_plural.sub(sub_plural, message)
return message

def translate(self, message, symbols):

   Variables   symbols("",)message'User %(id)s Logged-in'

Anybody have a clue?

Thanks.

-- 





[web2py] Re: Images not laoded

2012-11-10 Thread Julien Courteau
I realized, all of a sudden, that the images of my home page didn't use the 
{{=URL()}} notation...
That's why web2py didn't know how to fetch them ().
Thanks!

On Friday, November 9, 2012 11:33:30 PM UTC-5, pbreit wrote:
>
> Are you doing images like this?
>
> IMG(_src=URL('static','logo.png'), _alt="My Logo")
>
> or
>
> 
>
>
> On Friday, November 9, 2012 7:20:03 PM UTC-8, Julien Courteau wrote:
>>
>> Hello All,
>>
>> The images of my home page didn't load if I try to access it with the 
>> following URLs: 
>>
>> "localhost:8000/"
>> "localhost:8000/mm/"
>>
>> but loaded fine with:
>>
>> "localhost:8000/mm/default/" or
>> "localhost:8000/mm/default/index/"
>>
>> the name of my application being, of course, "mm" and my home page is 
>> displayed by
>> "default/index".
>> In the console of Firebug I've got the following error message for each 
>> images 
>> of the home page (when I try to access it by "/" or "/mm") :
>>
>> "NetworkError: 404 NOT FOUND - 
>> http://127.0.0.1:8000/static/images/image.jpg";.
>>
>> My folder image is under: "~/web2py/applications/mm/static/images".
>>
>> It is a problem if I want to set deafult_application = "mm" (in routes.py)...
>>
>> Could you help me understand that situation?
>>
>> Thanks.
>>
>

-- 





[web2py] Images not laoded

2012-11-09 Thread Julien Courteau
Hello All,

The images of my home page didn't load if I try to access it with the 
following URLs: 

"localhost:8000/"
"localhost:8000/mm/"

but loaded fine with:

"localhost:8000/mm/default/" or
"localhost:8000/mm/default/index/"

the name of my application being, of course, "mm" and my home page is 
displayed by
"default/index".
In the console of Firebug I've got the following error message for each 
images 
of the home page (when I try to access it by "/" or "/mm") :

"NetworkError: 404 NOT FOUND - http://127.0.0.1:8000/static/images/image.jpg";.

My folder image is under: "~/web2py/applications/mm/static/images".

It is a problem if I want to set deafult_application = "mm" (in routes.py)...

Could you help me understand that situation?

Thanks.

-- 





[web2py] DAl connection through a mysql socket

2012-10-30 Thread Julien Courteau
Hello,

I need to access a mysql db through a socket file from DAL. What is the 
connection string
I should use. The socket file is: "/tmp/mysql5.sock". Should I use 
something like that:
db = DAL('mysql://username:password@localhost:/tmp/mysql5.sock')?

Thanks.

--