[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
Apparently only in one example:

http://web2py.com/books/default/search/29?search=**dict

I can add something about this.

On Friday, 28 December 2012 01:24:37 UTC-6, at wrote:
>
> thank you massimo for this interesting and very useful tip ... it would 
> save my good amount of time 
> btw, is this syntax available in web2py documentation?
>
> On Friday, 28 December 2012 12:05:46 UTC+5, Massimo Di Pierro wrote:
>>
>> *db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(
>> [myfld] = myvalue)*
>> *
>> *
>> *should be*
>> *
>> *
>> *db((db[table_name].id == rowid) & (db[table_name][myfld] == 
>> "")).update(**{myfld:myvalue})*
>> *
>> *
>>
>>
>> On Friday, 28 December 2012 00:40:15 UTC-6, at wrote:
>>>
>>> It's working when I give table_name after getting table object 
>>> programatically, but when the same syntax is used for column names in 
>>> update statement it returns syntax error; please consider the following 
>>> statement:
>>> *db((db[table_name].id == rowid) & (db[table_name][myfld] == 
>>> "")).update([myfld] = myvalue)*
>>>
>>> thanks
>>>
>>> On Thursday, 27 December 2012 19:41:45 UTC+5, Anthony wrote:

 *
 db(db[tname].id  == rowid).select()

 *or just:

 db[tname](rowid)

 Anthony

 On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote:
>
>
> Wanted to avoid hard-coding table name in the following statement by 
> using var *tname*, but not successful: any tip pls?
> *db(db.tname.id == rowid).select*
>
> Thanks
>
> On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>>
>> gr8!
>> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>>
>> thanks very much!
>>
>> best regards
>>
>> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>>>
>>> Yes and No. You can get rows.colnames and they contain table names . 
>>> field name
>>>
>>> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:


 How can we get table name from ROWS object?

 Thanks

>>>

-- 





[web2py] Re: Installing the book as an app?

2012-12-27 Thread Nico Zanferrari
Hello, the right URL is https://github.com/mdipierro/web2py-book.git   ;-))


BTW, I've just found that it is imported right on PythonAnywhere, but it 
gives a ticket. Do you have any clue? Should I open a ticket?


Nico

 'title'

web2py™(2, 3, 2, datetime.datetime(2012, 12, 17, 15, 3, 30), 
'stable')PythonPython 
2.7.3: /usr/local/bin/uwsgi

Traceback (most recent call last):
  File "/home/nicozanf/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/home/nicozanf/web2py/applications/book/controllers/default.py" 
,
 line 56, in 
response.menu = build_menu()
  File "/home/nicozanf/web2py/gluon/cache.py", line 401, in __call__
self.time_expire)
  File "/home/nicozanf/web2py/gluon/cache.py", line 216, in __call__
value = f()
  File "/home/nicozanf/web2py/gluon/cache.py", line 400, in 
lambda a=a, b=b: self.func(*a, **b),
  File "/home/nicozanf/web2py/applications/book/controllers/default.py" 
,
 line 51, in build_menu
submenu.append((info['title']+' 
'+info['language'],None,URL('chapter',args=book_id)))
KeyError: 'title'


-- 





[web2py] Re: WWW SQL Designer to DAL converter

2012-12-27 Thread Massimo Di Pierro
Elcio,

what is your full name? Do you plan to mantain this? If so, I would include 
a section in the book about it and link your code.

Massimo

On Thursday, 27 December 2012 18:28:02 UTC-6, Elcio wrote:
>
> https://github.com/elcio/visualdal
>
> Feedback and suggestions, please.
>
> Elcio
> http://visie.com.br/
> http://elcio.com.br/
>  

-- 





Re: [web2py] Re: enum datatype in table definition

2012-12-27 Thread ajith c t
so using the argument db=DAL(' mysql://..  ' , check_reserved=['all']), 
it restricts the use of the mysql keywords. But the problem is the database 
which already available in mysql contains table name such "block", other 
that the "condition" field. So it impossible for me to change the database 
structure. 
One more thing I tried running sql query in mysql prompt but it doesnt give 
errors.
mysql> CREATE TABLE IF NOT EXISTS `rms_rule` (
->   `rule_id` smallint(8) unsigned NOT NULL,
->   `created_on` datetime NOT NULL,
->   `modified_on` datetime NOT NULL,
->   `created_by` int(11) NOT NULL,
->   `category_id` int(11) NOT NULL,
->   `is_active` tinyint(4) unsigned NOT NULL,
->   `action` enum('None','Review','Approve','Reject') NOT NULL,
->   `score` smallint(6) NOT NULL DEFAULT '0',
->   `field_id` smallint(5) unsigned NOT NULL,
->   `params_type` tinyint(3) unsigned NOT NULL,
->   `condition` 
enum('IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound')
 
NOT NULL,
->   `description` varchar(255) NOT NULL,
->   `params` varchar(255) NOT NULL,
->   PRIMARY KEY (`rule_id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.11 sec)

So what to do now,

Actually I got the db. define_table() script by running the 
extract_mysql_models.py script.  

On Friday, 28 December 2012 12:19:22 UTC+5:30, rochacbruno wrote:
>
>
>
> On Fri, Dec 28, 2012 at 4:46 AM, ajith c t 
> > wrote:
>
>> condition
>
>
> condition is a MySQL reserved keyword, you can't use this as the name of 
> table or field
>
> http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
>
> To solve this kinf od problems.
>
> db = DAL("mysql", check_reserved=["all"])
>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
thank you massimo for this interesting and very useful tip ... it would 
save my good amount of time 
btw, is this syntax available in web2py documentation?

On Friday, 28 December 2012 12:05:46 UTC+5, Massimo Di Pierro wrote:
>
> *db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(
> [myfld] = myvalue)*
> *
> *
> *should be*
> *
> *
> *db((db[table_name].id == rowid) & (db[table_name][myfld] == 
> "")).update(**{myfld:myvalue})*
> *
> *
>
>
> On Friday, 28 December 2012 00:40:15 UTC-6, at wrote:
>>
>> It's working when I give table_name after getting table object 
>> programatically, but when the same syntax is used for column names in 
>> update statement it returns syntax error; please consider the following 
>> statement:
>> *db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(
>> [myfld] = myvalue)*
>>
>> thanks
>>
>> On Thursday, 27 December 2012 19:41:45 UTC+5, Anthony wrote:
>>>
>>> *
>>> db(db[tname].id  == rowid).select()
>>>
>>> *or just:
>>>
>>> db[tname](rowid)
>>>
>>> Anthony
>>>
>>> On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote:


 Wanted to avoid hard-coding table name in the following statement by 
 using var *tname*, but not successful: any tip pls?
 *db(db.tname.id == rowid).select*

 Thanks

 On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>
> gr8!
> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>
> thanks very much!
>
> best regards
>
> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>>
>> Yes and No. You can get rows.colnames and they contain table names . 
>> field name
>>
>> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>>>
>>>
>>> How can we get table name from ROWS object?
>>>
>>> Thanks
>>>
>>

-- 





Re: [web2py] WWW SQL Designer to DAL converter

2012-12-27 Thread Massimo Di Pierro
Here is the file I meant to upload. 
https://dl.dropbox.com/u/18065445/Tmp/web2py.app.SqlDesigner.w2p

On Friday, 28 December 2012 01:12:32 UTC-6, Massimo Di Pierro wrote:
>
> Didn't we have this already?
>
> http://gaesql.appspot.com/
>
> I am not sure who owns that. I think this is the source:
> web2py.app.SqlDesigner.w2p
> but I am not 100% sure.
>
> Anyway, probably the one by Elcio is better. It would be nice if it could 
> go both ways (export and import).
>
> Massimo
>
> On Friday, 28 December 2012 00:56:28 UTC-6, rochacbruno wrote:
>>
>> Great!
>>
>> It would be nice if we automate the whole process, users put the .xml in 
>> /models or /private folder and this script can be called automatically if 
>> model doesnt exists, or we can put a button in admin "generate models" --> 
>> "upload the xml"
>>
>> I will do some tests!
>>
>> On Thu, Dec 27, 2012 at 10:28 PM, Elcio Ferreira wrote:
>>
>>> https://github.com/elcio/visualdal
>>>
>>> Feedback and suggestions, please.
>>>
>>> Elcio
>>> http://visie.com.br/
>>> http://elcio.com.br/
>>>  
>>> -- 
>>>  
>>>  
>>>  
>>>
>>
>>

-- 





Re: [web2py] WWW SQL Designer to DAL converter

2012-12-27 Thread Massimo Di Pierro
Didn't we have this already?

http://gaesql.appspot.com/

I am not sure who owns that. I think this is the source:
web2py.app.SqlDesigner.w2p
but I am not 100% sure.

Anyway, probably the one by Elcio is better. It would be nice if it could 
go both ways (export and import).

Massimo

On Friday, 28 December 2012 00:56:28 UTC-6, rochacbruno wrote:
>
> Great!
>
> It would be nice if we automate the whole process, users put the .xml in 
> /models or /private folder and this script can be called automatically if 
> model doesnt exists, or we can put a button in admin "generate models" --> 
> "upload the xml"
>
> I will do some tests!
>
> On Thu, Dec 27, 2012 at 10:28 PM, Elcio Ferreira 
> 
> > wrote:
>
>> https://github.com/elcio/visualdal
>>
>> Feedback and suggestions, please.
>>
>> Elcio
>> http://visie.com.br/
>> http://elcio.com.br/
>>  
>> -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] Replaced `auth_user` fields 'first_name' and 'last_name' with 'name'; now getting errors

2012-12-27 Thread Alec Taylor
Thanks, but that also isn't working: ` 'Row' object has no attribute
'first_name'`

But I do get a different traceback, i.e., here:

web2py\gluon\tools.py", line 1285, in navbar
user_identifier = user_identifier % self.user

On Fri, Dec 28, 2012 at 5:41 PM, Bruno Rocha  wrote:
>
> For the record:
>
> There is a problem on this line
> https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1415
>
> If you use auth.signature it will raise an error do I propose to change it
> to:
>
> return '%s %s' % (user.get("first_name", "email"), user.get("last_name",
> ""))
>
> or some other check.
>
> --
>
>
>

-- 





Re: [web2py] Re: Unable to set is_active=True when record_versioning is enabled

2012-12-27 Thread Mandar Vaze / मंदार वझे
On Fri, Dec 28, 2012 at 12:33 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> If we allow setting is_active from False to True we would be able to
> re-cycle the record and there would be a record of the recycling (who
> deleted it, who restored it, and when).


Considering there would be a trail of restoration, this option is better.

-Mandar

-- 





[web2py] Re: enum datatype in table definition

2012-12-27 Thread Massimo Di Pierro
ok, change in trunk.

On Friday, 28 December 2012 00:46:05 UTC-6, ajith c t wrote:
>
> Thanks Niphold, I used your code but now it is showing another error, I 
> have seen this error before also but dont know whats exactly wrong here,
> Below is my table definition, 
>
> db.define_table('some_rule', 
> Field('rule_id', 'integer', notnull=True),  # (`rule_id` smallint(8) 
> unsigned NOT NULL,)
> Field('created_on', 'datetime', notnull=True),  # (`created_on` 
> datetime NOT NULL,)
> Field('modified_on', 'datetime', notnull=True),  # (`modified_on` 
> datetime NOT NULL,)
> Field('created_by', 'integer', notnull=True),  # (`created_by` int(11) 
> NOT NULL,)
> Field('category_id', 'integer', notnull=True),  # (`category_id` 
> int(11) NOT NULL,)
> Field('is_active', 'integer', notnull=True),  # (`is_active` 
> tinyint(4) unsigned NOT NULL,)
> Field('action', 'string', notnull=True),   # (`action` 
> enum('None','Review','Approve','Reject') NOT NULL,)
> Field('score', 'integer', notnull=True),   # (`score` smallint(6) NOT 
> NULL DEFAULT '0',)
> Field('field_id', 'integer', notnull=True),  # (`field_id` smallint(5) 
> unsigned NOT NULL,)
> Field('params_type', 'integer', notnull=True),  # (`params_type` 
> tinyint(3) unsigned NOT NULL,)
> Field('condition', 
> requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound'])),
>  
>  
> Field('description', 'string', notnull=True),  # (`description` 
> varchar(255) NOT NULL,)
> Field('params', 'string', notnull=True),   # (`params` varchar(255) 
> NOT NULL,)
> migrate='some_rule.table'
> )
>
> But this one gives me an error as,
>
>(1064, "You have an error 
> in your SQL syntax; check the manual that corresponds to your MySQL server 
> version for the right syntax to use near 'condition VARCHAR(255)' at line 
> 1")
>
> I checked the sql log,
>  the last statement at the time of error is 
>
> timestamp: 2012-12-28T12:07:19.578109
> ALTER TABLE rms_rule ADD condition VARCHAR(255);
>
> I am developing this application and is stuck at this point please help me
>
>
> On Thursday, 27 December 2012 19:12:58 UTC+5:30, Niphlod wrote:
>>
>> Field('condition', requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater'
>> ,'IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In'
>> ,'NotIn','Found','NotFound']))
>>
>>
>>
>> Il giorno giovedì 27 dicembre 2012 13:30:04 UTC+1, ajith c t ha scritto:
>>>
>>>
>>>
>>>  Field('condition', 
>>> enum('IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound'),
>>>  
>>> notnull=True), 
>>>
>>> the above syntax gives me error while defining the table in web2py.  how 
>>> can one specify an enum datatype in web2py table definition
>>>
>>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
*db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(
[myfld] = myvalue)*
*
*
*should be*
*
*
*db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(**{
myfld:myvalue})*
*
*


On Friday, 28 December 2012 00:40:15 UTC-6, at wrote:
>
> It's working when I give table_name after getting table object 
> programatically, but when the same syntax is used for column names in 
> update statement it returns syntax error; please consider the following 
> statement:
> *db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(
> [myfld] = myvalue)*
>
> thanks
>
> On Thursday, 27 December 2012 19:41:45 UTC+5, Anthony wrote:
>>
>> *
>> db(db[tname].id  == rowid).select()
>>
>> *or just:
>>
>> db[tname](rowid)
>>
>> Anthony
>>
>> On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote:
>>>
>>>
>>> Wanted to avoid hard-coding table name in the following statement by 
>>> using var *tname*, but not successful: any tip pls?
>>> *db(db.tname.id == rowid).select*
>>>
>>> Thanks
>>>
>>> On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:

 gr8!
 *tname,z=my_rows.colnames[0].split('.')* gave the desired table name

 thanks very much!

 best regards

 On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>
> Yes and No. You can get rows.colnames and they contain table names . 
> field name
>
> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>>
>>
>> How can we get table name from ROWS object?
>>
>> Thanks
>>
>

-- 





Re: [web2py] Re: Unable to set is_active=True when record_versioning is enabled

2012-12-27 Thread Massimo Di Pierro
If we allow setting is_active from False to True we would be able to 
re-cycle the record and there would be a record of the recycling (who 
deleted it, who restored it, and when).

If we clone a deleted record we break references to it and it would be hard 
to track the consequences of the restoration.

Massimo

On Friday, 28 December 2012 00:19:54 UTC-6, Mandar Vaze wrote:
>
>  
>
>> You should be able to clone a deleted record however.
>
>
> I agree. An ability to "clone" the deleted record would be great. I assume 
> no such feature exists (correct ? I didn't find any)
>
> If you are just using your auditing log like a recycle bin, then please 
>> name it as such.
>>
>
> Minor nitpick - Current behavior isn't EXACTLY like a recycle 
> bin. Recycle Bin indicates an object has gone FROM one location to recycle 
> bin. But in this case, the older copy of record is copied to archive table 
> and record itself is MODIFIED (is_active=False)
>
> In any case, you can count this as a vote for not allowing undeletes by 
>> changing the is_active flag.
>>
>
> I'm OK with this as well. 
>
> -Mandar
>

-- 





Re: [web2py] Re: enum datatype in table definition

2012-12-27 Thread ajith c t
Does it mean that i need to change the field name from condition to 
anything else...or the argument check_reserved=['all'] allows to use the 
reserved keywords. 
The manual says it checks for the reserved keywords, but didn't understand 
whether it will block or skip these keywords.

And one more thing this table is part of a working mysql database. I am 
integrating it into web2py. 

On Friday, 28 December 2012 12:19:22 UTC+5:30, rochacbruno wrote:
>
>
>
> On Fri, Dec 28, 2012 at 4:46 AM, ajith c t 
> > wrote:
>
>> condition
>
>
> condition is a MySQL reserved keyword, you can't use this as the name of 
> table or field
>
> http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
>
> To solve this kinf od problems.
>
> db = DAL("mysql", check_reserved=["all"])
>

-- 





Re: [web2py] WWW SQL Designer to DAL converter

2012-12-27 Thread Bruno Rocha
Great!

It would be nice if we automate the whole process, users put the .xml in
/models or /private folder and this script can be called automatically if
model doesnt exists, or we can put a button in admin "generate models" -->
"upload the xml"

I will do some tests!

On Thu, Dec 27, 2012 at 10:28 PM, Elcio Ferreira  wrote:

> https://github.com/elcio/visualdal
>
> Feedback and suggestions, please.
>
> Elcio
> http://visie.com.br/
> http://elcio.com.br/
>
> --
>
>
>
>

-- 





Re: [web2py] Re: enum datatype in table definition

2012-12-27 Thread Bruno Rocha
On Fri, Dec 28, 2012 at 4:46 AM, ajith c t  wrote:

> condition


condition is a MySQL reserved keyword, you can't use this as the name of
table or field

http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html

To solve this kinf od problems.

db = DAL("mysql", check_reserved=["all"])

-- 





[web2py] Re: enum datatype in table definition

2012-12-27 Thread ajith c t
Thanks Niphold, I used your code but now it is showing another error, I 
have seen this error before also but dont know whats exactly wrong here,
Below is my table definition, 

db.define_table('some_rule', 
Field('rule_id', 'integer', notnull=True),  # (`rule_id` smallint(8) 
unsigned NOT NULL,)
Field('created_on', 'datetime', notnull=True),  # (`created_on` 
datetime NOT NULL,)
Field('modified_on', 'datetime', notnull=True),  # (`modified_on` 
datetime NOT NULL,)
Field('created_by', 'integer', notnull=True),  # (`created_by` int(11) 
NOT NULL,)
Field('category_id', 'integer', notnull=True),  # (`category_id` 
int(11) NOT NULL,)
Field('is_active', 'integer', notnull=True),  # (`is_active` tinyint(4) 
unsigned NOT NULL,)
Field('action', 'string', notnull=True),   # (`action` 
enum('None','Review','Approve','Reject') NOT NULL,)
Field('score', 'integer', notnull=True),   # (`score` smallint(6) NOT 
NULL DEFAULT '0',)
Field('field_id', 'integer', notnull=True),  # (`field_id` smallint(5) 
unsigned NOT NULL,)
Field('params_type', 'integer', notnull=True),  # (`params_type` 
tinyint(3) unsigned NOT NULL,)
Field('condition', 
requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound'])),
 
 
Field('description', 'string', notnull=True),  # (`description` 
varchar(255) NOT NULL,)
Field('params', 'string', notnull=True),   # (`params` varchar(255) NOT 
NULL,)
migrate='some_rule.table'
)

But this one gives me an error as,

   (1064, "You have an error in 
your SQL syntax; check the manual that corresponds to your MySQL server 
version for the right syntax to use near 'condition VARCHAR(255)' at line 
1")

I checked the sql log,
 the last statement at the time of error is 

timestamp: 2012-12-28T12:07:19.578109
ALTER TABLE rms_rule ADD condition VARCHAR(255);

I am developing this application and is stuck at this point please help me


On Thursday, 27 December 2012 19:12:58 UTC+5:30, Niphlod wrote:
>
> Field('condition', requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater',
> 'IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In',
> 'NotIn','Found','NotFound']))
>
>
>
> Il giorno giovedì 27 dicembre 2012 13:30:04 UTC+1, ajith c t ha scritto:
>>
>>
>>
>>  Field('condition', 
>> enum('IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound'),
>>  
>> notnull=True), 
>>
>> the above syntax gives me error while defining the table in web2py.  how 
>> can one specify an enum datatype in web2py table definition
>>
>

-- 





Re: [web2py] Replaced `auth_user` fields 'first_name' and 'last_name' with 'name'; now getting errors

2012-12-27 Thread Bruno Rocha
For the record:

There is a problem on this line
https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1415

If you use auth.signature it will raise an error do I propose to change it
to:

return '%s %s' % (user.get("first_name", "email"), user.get("last_name",
""))

or some other check.

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
It's working when I give table_name after getting table object 
programatically, but when the same syntax is used for column names in 
update statement it returns syntax error; please consider the following 
statement:
*db((db[table_name].id == rowid) & (db[table_name][myfld] == "")).update(
[myfld] = myvalue)*

thanks

On Thursday, 27 December 2012 19:41:45 UTC+5, Anthony wrote:
>
> *
> db(db[tname].id  == rowid).select()
>
> *or just:
>
> db[tname](rowid)
>
> Anthony
>
> On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote:
>>
>>
>> Wanted to avoid hard-coding table name in the following statement by 
>> using var *tname*, but not successful: any tip pls?
>> *db(db.tname.id == rowid).select*
>>
>> Thanks
>>
>> On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>>>
>>> gr8!
>>> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>>>
>>> thanks very much!
>>>
>>> best regards
>>>
>>> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:

 Yes and No. You can get rows.colnames and they contain table names . 
 field name

 On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>
>
> How can we get table name from ROWS object?
>
> Thanks
>


-- 





Re: [web2py] Replaced `auth_user` fields 'first_name' and 'last_name' with 'name'; now getting errors

2012-12-27 Thread Bruno Rocha
I think your problem is in navbar()

navbar function uses a parameter user_identifier which is DEFAULT to
%(first_name)s but you can change it.

go to your layout.html and replace

auth.navbar(mode="dropdown")

with

auth.navbar(mode="dropdown", *user_identifier="%(name)s"*)

-- 





[web2py] Can the parametric router 301 redirect from www?

2012-12-27 Thread HittingSmoke
Pretty straight forward question. Can I use the parametric routes.py 
language to 301 redirect from www.domain.com to domain.com for proper 
search engine crawling?

-- 





Re: [web2py] Replaced `auth_user` fields 'first_name' and 'last_name' with 'name'; now getting errors

2012-12-27 Thread Bruno Rocha
Please provide a full ticket traceback for us to see where exactly it is
happening.

On Fri, Dec 28, 2012 at 4:21 AM, Alec Taylor  wrote:

> Replaced auth_user fields 'first_name' and 'last_name' with 'name';
> now I am getting errors.
>
> My reasoning for using a single 'name' field is to shorten the time it
> takes for new users to sign up.
>
> They are able to add more to their profile after this, but the concept
> with my website is people will signup on "impulse" thus its signup
> forms need to contain as few fields as possible.
>
> I have done a grep of my entire app and 'first_name' is not mentioned
> anywhere; except in my errors directory!
>
> It seems that `gluon\tools.py` has hard-coded for you to use the
> 'first_name' with 'last_name' convention.
>
> Can we make this a parameter instead?
>
> Or is there another way I can get around this?
>
> Thanks for all suggestions,
>
> Alec Taylor
>
> BTW: The error is: ` 'Row' object
> has no attribute 'first_name'`
>
> --
>
>
>
>

-- 





[web2py] Replaced `auth_user` fields 'first_name' and 'last_name' with 'name'; now getting errors

2012-12-27 Thread Alec Taylor
Replaced auth_user fields 'first_name' and 'last_name' with 'name';
now I am getting errors.

My reasoning for using a single 'name' field is to shorten the time it
takes for new users to sign up.

They are able to add more to their profile after this, but the concept
with my website is people will signup on "impulse" thus its signup
forms need to contain as few fields as possible.

I have done a grep of my entire app and 'first_name' is not mentioned
anywhere; except in my errors directory!

It seems that `gluon\tools.py` has hard-coded for you to use the
'first_name' with 'last_name' convention.

Can we make this a parameter instead?

Or is there another way I can get around this?

Thanks for all suggestions,

Alec Taylor

BTW: The error is: ` 'Row' object
has no attribute 'first_name'`

-- 





Re: [web2py] Re: Unable to set is_active=True when record_versioning is enabled

2012-12-27 Thread Mandar Vaze / मंदार वझे
> You should be able to clone a deleted record however.


I agree. An ability to "clone" the deleted record would be great. I assume
no such feature exists (correct ? I didn't find any)

If you are just using your auditing log like a recycle bin, then please
> name it as such.
>

Minor nitpick - Current behavior isn't EXACTLY like a recycle
bin. Recycle Bin indicates an object has gone FROM one location to recycle
bin. But in this case, the older copy of record is copied to archive table
and record itself is MODIFIED (is_active=False)

In any case, you can count this as a vote for not allowing undeletes by
> changing the is_active flag.
>

I'm OK with this as well.

-Mandar

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
thanks all for the prompt response & help.

regards

On Thursday, 27 December 2012 19:41:45 UTC+5, Anthony wrote:
>
> *
> db(db[tname].id  == rowid).select()
>
> *or just:
>
> db[tname](rowid)
>
> Anthony
>
> On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote:
>>
>>
>> Wanted to avoid hard-coding table name in the following statement by 
>> using var *tname*, but not successful: any tip pls?
>> *db(db.tname.id == rowid).select*
>>
>> Thanks
>>
>> On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>>>
>>> gr8!
>>> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>>>
>>> thanks very much!
>>>
>>> best regards
>>>
>>> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:

 Yes and No. You can get rows.colnames and they contain table names . 
 field name

 On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>
>
> How can we get table name from ROWS object?
>
> Thanks
>


-- 





[web2py] Found correct SQL for left joins with is_active; can dal emit this query?

2012-12-27 Thread Cliff Kachinske
Works with Postgres.  Not sure about other rdbms.

The query should look like this:

SELECT parent_table.some_field, child_table.other_field FROM parent_table 
LEFT JOIN child_table ON child_table.parent_id = parent_table.id AND 
child_table.is_active = 'T'
WHERE parent_table.is_active = 'T';

I am not aware of any way to cause the dal to emit this query.  Is it 
possible?

-- 





Re: [web2py] Re: session.flash not working?

2012-12-27 Thread Massimo Di Pierro
Please post an example to reproduce the problem. Could it be a js issue? Do 
you get chrome errors? Is the flash in the page text?

On Thursday, 27 December 2012 17:55:46 UTC-6, VP wrote:
>
> session.flash does not work properly for me either (latest web2py stable 
> version).
>
> when i redirect to the same controller , it works for some controller and 
> doesn't work for other controllers.
>
> Have no idea why.
>

-- 





[web2py] Re: Installing the book as an app?

2012-12-27 Thread Tim Richardson


On Friday, 28 December 2012 00:46:05 UTC+11, Massimo Di Pierro wrote:
>
> You may not have python-git installed. 


On my mac, I did
easy_install gitpython

which succeeded.

However, loading the book app from the github URL failed with the same 
message as before.

-- 





Re: [web2py] Deploy nginx + uwsgi

2012-12-27 Thread Bruno Rocha
I see something strange, your 80 port is using IP adress and 443 is using
unix socket.

Can you access using https:// ??

On Fri, Dec 28, 2012 at 1:43 AM, FERNANDO VILLARROEL
wrote:

> Dear All.
>
> I am trying to migrated my web2py applications from apache to nginx +
> uwsgi.
>
> So i did configured a Ubuntu Server, i follow the script :
>
>
> http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
>
> My problem is i can't deploy mi domain: administrator.midomain.com, i
> received Bad Gateway.
>
> My /etc/nginx/administrator:
>
>
> server {
> listen  80;
> server_name administrator.mydomain.com;
> location ~* /(\w+)/static/ {
>root /home/www-data/web2py/applications/;
> }
>  location / {
> uwsgi_pass  127.0.0.1:9001;
> #uwsgi_pass
>  unix:///run/uwsgi/app/web2py/web2py.socket;
> include uwsgi_params;
> #uwsgi_param UWSGI_SCHEME $scheme;
> #uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
> }
> }
>
> server {
> listen  443;
> server_name administrator.mydomain.com;
> ssl on;
> ssl_certificate /etc/nginx/ssl/web2py.crt;
> ssl_certificate_key /etc/nginx/ssl/web2py.key;
> location / {
> #uwsgi_pass  127.0.0.1:9001;
> uwsgi_pass  unix:///run/uwsgi/app/web2py/web2py.socket;
> include uwsgi_params;
> uwsgi_param UWSGI_SCHEME $scheme;
> uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
> }
>
> }
>
>
>
> I do not know How should the file /etc/uwsgi/administrator.xml?
>
> My deploy is running ok, when i write my wan IP of my ubuntu server on my
> Browser like Chrome, the welcome application show perfectly, but i told you
> i need help for configuration of  uwsgi for i  can deploy my virtualhost
> like apache:
>
> adminstrator.mydomain.com
>
> The route of the this application administrator is
> /home/www-data/web2py/applications/administrator
>
> I am not using Virtualenv on my ubuntu server.
>
> I hope you help for i can deploy my applications with nginx and uwsgi.
>
> Regards.
>
> Fernando.
>
> --
>
>
>
>

-- 





Re: [web2py] Deploy nginx + uwsgi

2012-12-27 Thread FERNANDO VILLARROEL
Dear Bruno.
Not i am using only http.
maybe I should delete the https config of my nginx file (443).
But i need help for i can config the /etc/uwsgi/administrator.xml for deploy 
the application /home/www-data/web2py/applications/administrator with my domain 
administartor.mydomain.com
Regards.

--- On Thu, 12/27/12, Bruno Rocha  wrote:

From: Bruno Rocha 
Subject: Re: [web2py] Deploy nginx + uwsgi
To: web2py@googlegroups.com
Date: Thursday, December 27, 2012, 11:47 PM

I see something strange, your 80 port is using IP adress and 443 is using unix 
socket.
Can you access using https:// ??

On Fri, Dec 28, 2012 at 1:43 AM, FERNANDO VILLARROEL  
wrote:


Dear All.



I am trying to migrated my web2py applications from apache to nginx + uwsgi.



So i did configured a Ubuntu Server, i follow the script :



http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh



My problem is i can't deploy mi domain: administrator.midomain.com, i received 
Bad Gateway.



My /etc/nginx/administrator:





server {

        listen          80;

        server_name     administrator.mydomain.com;

        location ~* /(\w+)/static/ {

           root /home/www-data/web2py/applications/;

        }

         location / {

                uwsgi_pass      127.0.0.1:9001;

                #uwsgi_pass      unix:///run/uwsgi/app/web2py/web2py.socket;

                include         uwsgi_params;

                #uwsgi_param     UWSGI_SCHEME $scheme;

                #uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;

        }

}



server {

        listen          443;

        server_name     administrator.mydomain.com;

        ssl                     on;

        ssl_certificate         /etc/nginx/ssl/web2py.crt;

        ssl_certificate_key     /etc/nginx/ssl/web2py.key;

        location / {

                #uwsgi_pass      127.0.0.1:9001;

                uwsgi_pass      unix:///run/uwsgi/app/web2py/web2py.socket;

                include         uwsgi_params;

                uwsgi_param     UWSGI_SCHEME $scheme;

                uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;

        }



}







I do not know How should the file /etc/uwsgi/administrator.xml?



My deploy is running ok, when i write my wan IP of my ubuntu server on my 
Browser like Chrome, the welcome application show perfectly, but i told you i 
need help for configuration of  uwsgi for i  can deploy my virtualhost like 
apache:





adminstrator.mydomain.com



The route of the this application administrator is 
/home/www-data/web2py/applications/administrator



I am not using Virtualenv on my ubuntu server.



I hope you help for i can deploy my applications with nginx and uwsgi.



Regards.



Fernando.



--












-- 

 

 

 

-- 





[web2py] Deploy nginx + uwsgi

2012-12-27 Thread FERNANDO VILLARROEL
Dear All.

I am trying to migrated my web2py applications from apache to nginx + uwsgi.

So i did configured a Ubuntu Server, i follow the script :

http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

My problem is i can't deploy mi domain: administrator.midomain.com, i received 
Bad Gateway.

My /etc/nginx/administrator:


server {
listen  80;
server_name administrator.mydomain.com;
location ~* /(\w+)/static/ {
   root /home/www-data/web2py/applications/;
}
 location / {
uwsgi_pass  127.0.0.1:9001;
#uwsgi_pass  unix:///run/uwsgi/app/web2py/web2py.socket;
include uwsgi_params;
#uwsgi_param UWSGI_SCHEME $scheme;
#uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}
}

server {
listen  443;
server_name administrator.mydomain.com;
ssl on;
ssl_certificate /etc/nginx/ssl/web2py.crt;
ssl_certificate_key /etc/nginx/ssl/web2py.key;
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///run/uwsgi/app/web2py/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}

}



I do not know How should the file /etc/uwsgi/administrator.xml?

My deploy is running ok, when i write my wan IP of my ubuntu server on my 
Browser like Chrome, the welcome application show perfectly, but i told you i 
need help for configuration of  uwsgi for i  can deploy my virtualhost like 
apache:

adminstrator.mydomain.com

The route of the this application administrator is 
/home/www-data/web2py/applications/administrator

I am not using Virtualenv on my ubuntu server.

I hope you help for i can deploy my applications with nginx and uwsgi.

Regards.

Fernando.

-- 





Re: [web2py] Re: session.flash not working?

2012-12-27 Thread VP
session.flash does not work properly for me either (latest web2py stable 
version).

when i redirect to the same controller , it works for some controller and 
doesn't work for other controllers.

Have no idea why.

-- 





[web2py] important. help with book 5th ed acknowledgments

2012-12-27 Thread Massimo Di Pierro
I am updating the book acknowledgements. Am I forgetting somebody? Please 
do not be shy. If you are not there and you should be assume it is an 
oversight and not intentional. One reasons probably you are not there is 
that I only know your username but not your full name. 

Let me know asap.

Adam Bryzak,
Adam Gojdas,
Adrian Klaver,
Alain Boulch,
Alan Etkin,
Alec Taylor,
Alexandre Andrade,
Alexey Nezhdanov,
Alvaro Justen,
Anand Vaidya,
Anatoly Belyakov,
Ander Arbelaiz,
Anders Roos,
Andrew Replogle,
Andrew Willimott,
Angelo Compagnucci,
Angelo and Villas,
Annet Vermeer,
Anthony Bastardi,
Anton Muecki,
Antonio Ramos,
Arun Rajeevan,
Attila Csipa,
Ben Goosman,
Ben Reinhart,
Benjamin,
Bernd Rothert,
Bill Ferret,
Blomqvist,
Boris Manojlovic,
Branko Vukelic,
Brent Zeiben,
Brian Cottingham,
Brian Harrison,
Brian Meredyk,
Bruno Rocha,
CJ Lazell,
Caleb Hattingh,
Carlos Galindo,
Carlos Hanson,
Carsten Haese,
Cedric Meyer,
Charles Law,
Charles Winebrinner,
Chris Clark,
Chris May,
Chris Sanders,
Christian Foster Howes,
Christopher Smiga,
Christopher Steel,
Clavin Sim,
Cliff Kachinske,
Corne Dickens,
Craig Younkins,
Dan McGee,
Dan Ragubba,
Daniel Gonz,
Daniel Haag,
Daniel Lin,
Dave Stoll,
David Adley,
David Harrison,
David Lin,
David Marko,
David Wagner,
Denes Lengyel,
Diaz Luis,
Dirk Krause,
Dominic Koenig,
Doug Warren,
Douglas Philips,
Douglas Soares de Andrade,
Douglas and Alan,
Dustin Bensing,
Elcio Ferreira,
Eric Vicenti,
Falko Krause,
Farsheed Ashouri,
Felipe Meirelles,
Flavien Scheurer,
Fran Boon,
Francisco Gama,
Fred Yanowski,
Friedrich Weber,
Gabriele Alberti,
Gergely Kontra,
Gergely Peli,
Gerley Kontra,
Gilson Filho,
Glenn Caltech,
Graham Dumpleton,
Gregory Benjamin,
Gustavo Di Pietro,
Gyuris Szabolcs,
Hamdy Abdel-Badeea,
Hans C. v. Stockhausen,
Hans Donner,
Hans Murx,
Huaiyu Wang,
Ian Reinhart Geiser,
Iceberg,
Igor Gassko,
Ismael Serratos,
Jan Beilicke,
Jay Kelkar,
Jeff Bauer,
Jesus Matrinez,
Jim Karsten,
Joachim Breitsprecher,
Joakim Eriksson,
Joe Barnhart,
Joel Carrier,
Joel Samuelsson,
John Heenan,
Jon Romero,
Jonas Rundberg,
Jonathan Benn,
Jonathan Lundell,
Jose Jachuf,
Joseph Piron,
Josh Goldfoot,
Josh Jaques,
José Vicente de Sousa,
Jurgis Pralgauskis,
Keith Yang,
Kenji Hosoda,
Kenneth Lundstr,
Kirill Spitsin,
Kyle Smith,
Larry Weinberg,
Limodou,
Loren McGinnis,
Louis DaPrato,
Luca Zachetti,
Lucas D'Ávila,
Madhukar R Pai,
Manuele Presenti,
Marc Abramowitz,
Marcel Hellkamp,
Marcel Leuthi,
Marcello Della Longa,
Maria Mitica,
Mariano Reingart,
Marin Prajic,
Marin Pranji,
Marius van Niekerk,
Mark Kirkwood,
Mark Larsen,
Mark Moore,
Markus Gritsch,
Mart Senecal,
Martin Hufsky,
Martin Mulone,
Martin Weissenboeck,
Mateusz Banach,
Mathew Grabau,
Mathieu Clabaut,
Matt Doiron,
Matthew Norris,
Michael Fig,
Michael Herman,
Michael Howden,
Michael Jursa,
Michael Toomim,
Michael Willis,
Michele Comitini,
Miguel Goncalves,
Miguel Lopez,
Mike Amy,
Mike Dickun,
Mike Ellis,
Mike Pechkin,
Milan Melena,
Muhammet Aydin,
Napoleon Moreno,
Nathan Freeze,
Niall Sweeny,
Niccolo Polo,
Nick Groenke,
Nico de Groot,
Nicolas Bruxer,
Nik Klever,
Olaf Ferger,
Oliver Dain,
Olivier Roch Vilato,
Omi Chiba,
Ondrej Such,
Ont Rif,
Oscar Benjamin,
Osman Masood,
Ovidio Marinho Falcao Neto,
Pai,
Panos Jee,
Paolo Betti,
Paolo Caruccio,
Paolo Gasparello,
Paolo Velleri,
Patrick Breitenbach,
Pearu Peterson,
Peli Gergely,
Pete Hunt,
Phyo Arkar Lwin,
Pierre Thibault,
Pieter Muller,
Piotr Banasziewicz,
Ramjee Ganti,
Richard Gordon,
Richard Ree,
Robert Kooij,
Robert Valentak,
Robin Bhattacharyya,
Roman Bataev,
Ron McOuat,
Ross Peoples,
Ruijun Luo,
Running Calm,
Ryan Seto,
Salomon Derossi,
Sam Sheftel,
Scott Roberts,
Sergey Podlesnyi,
Sharriff Aina,
Simone Bizzotto,
Sriram Durbha,
Sterling Hankins,
Stuart Rackham,
Telman Yusupov,
Thadeus Burgess,
Thomas Dallagnese,
Tim Farrell,
Tim Michelsen,
Timothy Farrell,
Tito Garrido,
Tyrone Hattingh,
Vasile Ermicioi,
Vidul Nikolaev Petrov,
Vidul Petrov,
Vinicius Assef,
Vladimir Donnikov,
Vladyslav Kozlovsky,
Vladyslav Kozlovskyy,
Wang Huaiyu,
Wes James,
Will Stevens,
Yair Eshel,
Yarko Tymciurak,
Yoshiyuki Nakamura,
Younghyun Jo,
Zahariash.


-- 





Re: [web2py] book 5th ed. Need help

2012-12-27 Thread Massimo Di Pierro
If the labor is divided than I cannot pay because it is too complicated. 
But if you do all of them then I will be happy to pay you. We can discuss 
this off-line when you send me the samples.

Massimo

On Thursday, 27 December 2012 16:03:31 UTC-6, Roberto Perdomo wrote:
>
> I can help with that. Tonight beginning, and I send you some example.
>
> PS: No need to pay me for it.
>
> Regards.
>
>
> 2012/12/27 Massimo Di Pierro >
>
>> I need help to redo all screenshots in the book using the latest web2py.
>>
>> I am looking for a few volunteers. Almost all of the screenshots are in 
>> chapter 3, 7, and 9.
>>
>> They should be done using Chrome without toolbars.
>> Here are current screenshots:
>>
>> https://github.com/mdipierro/web2py-book/tree/master/sources/29-web2py-english/images
>> The new screenshots should have the same name and format.
>>
>> If one of you wants to them all and can do in 3 days, send me an example 
>> of a couple of screenshots privately (to make sure they look good) and I 
>> will pay you $150 for all of them.
>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] book 5th ed. Need help

2012-12-27 Thread Roberto Perdomo
I can help with that. Tonight beginning, and I send you some example.

PS: No need to pay me for it.

Regards.


2012/12/27 Massimo Di Pierro 

> I need help to redo all screenshots in the book using the latest web2py.
>
> I am looking for a few volunteers. Almost all of the screenshots are in
> chapter 3, 7, and 9.
>
> They should be done using Chrome without toolbars.
> Here are current screenshots:
>
> https://github.com/mdipierro/web2py-book/tree/master/sources/29-web2py-english/images
> The new screenshots should have the same name and format.
>
> If one of you wants to them all and can do in 3 days, send me an example
> of a couple of screenshots privately (to make sure they look good) and I
> will pay you $150 for all of them.
>
>  --
>
>
>
>

-- 





[web2py] Re: new admin in trunk

2012-12-27 Thread Alan Etkin
Looks nice. Really. I didn't find any issues so far with a basic usage.

El lunes, 24 de diciembre de 2012 17:00:29 UTC-3, Massimo Di Pierro 
escribió:
>
> As a Christmas present (not from me but from Paolo) there is a new admin 
> in trunk based on Bootstrap. Please check it out.
> If this is ok we should soon commit 2.4.1 because there are yet more bug 
> fixes. ;-)
>
> Massimo
>

-- 





[web2py] Re: delete uploads with SQLFORM.factory

2012-12-27 Thread Paolo
Hi Massimo, thank for the answer, I updated the code but the problem is 
still there, I made several tests, no one figured out what is wrong. So 
that I tried to simplify the code as follows:
db.define_table('test_img',
Field("picture", "upload", 
  uploadfolder=os.path.join(request.folder,'uploads','pictures'), 
  uploadseparate=True),
Field('created_on', 'datetime', default=request.now, writable=False)
)

def sqlform_add():
form = SQLFORM.factory(db.test_img, _class='well',
   upload=URL('default', 'download'),
   uploadfolder=os.path.join(request.folder,
'uploads','pictures'),  
   uploadseparate=True, table_name='test')
if form.process(dbio=False).accepted:
id = db.test_img.insert(**dict(form.vars))
return response.render('generic.html', dict(form=form))

def sqlform_edit():
img = db(db.test_img.id>0).select().first()
db.test_img['picture'].default = img['picture']
form = SQLFORM.factory(db.test_img, _class='well',
   upload=URL('default', 'download'),
   uploadfolder=os.path.join(request.folder,
'uploads','pictures'),  
   uploadseparate=True, table_name='test')
if form.process(dbio=False).accepted:
print 'form accepted'
return response.render('generic.html', dict(form=form))

what I got:
- adding an img with sqlform_add and then removing it with appadmin  --> 
worked
- adding an img with appadmin and then removing it with sqlform_edit --> 
failed 
- using both sqlform_add and sqlform_edit --> failed
Now I am thinking about the way I set the default value, maybe for a field 
as an upload I have to set something more?

Paolo

On Thursday, December 27, 2012 9:28:54 PM UTC+1, Massimo Di Pierro wrote:
>
> perhaps not the cause of the problem but
>
> request.folder+'uploads/pictures'
>
> should be
>
> os.path.join(request.folder,'uploads','pictures')
>
> On Thursday, 27 December 2012 00:30:00 UTC-6, Paolo wrote:
>>
>> Hi Massimo, 
>> I've just tried to post and then edit with both SQLFORM.factory having  
>> uploadseparate but nothing has changed. The problem is still there, 
>> actually I am making explicitly inserts and  edits. 
>> The whole SQLFORM.factory to edit a field is this:
>> for field in ['title','description', 'user_contact','picture' 
>> ]:
>> db.club[field].default = club[field]
>> for field in ['name']:
>> db.cities[field].default = city[field]
>> form = SQLFORM.factory(db.club, db.cities, _class='well', 
>>formstyle='bootstrap', showid= False,
>>upload=URL('default', 
>> 'download'),uploadfolder
>> =request.folder+'uploads/pictures',  
>>uploadseparate=True, 
>> autodelete=True,table_name
>> ='club')
>>
>>
>> Paolo
>>
>>
>>
>> On Thursday, December 27, 2012 12:47:19 AM UTC+1, Massimo Di Pierro wrote:
>>>
>>> Did you upload the file first and then add uploadseparate/uploadfolder?  
>>>
>>> On Wednesday, 26 December 2012 12:49:01 UTC-6, Paolo wrote:

 Hi all, 
 it seems to me that SQLFORM.factory doesn't honor the uploadseparate 
 option because I'am not able to delete the uploaded file with 
 SQLFORM.factory

 form = SQLFORM.factory(db.club, db.cities, _class='well', 
formstyle='bootstrap', showid= False,
upload=URL('default', 'download'), uploadfolder=
 request.folder+'uploads/pictures',  
uploadseparate=True, autodelete=True, table_name
 ='club'  )

  

 The error:
 Enter code here...2012-12-26 19:38:07,728 - web2py - ERROR - Traceback 
 (most recent call last):
   File "/home/paolo/Dropbox/git/web2py/gluon/restricted.py", line 212, 
 in restricted
 exec ccode in environment
   File 
 "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
 , line 123, in 
   File "/home/paolo/Dropbox/git/web2py/gluon/globals.py", line 193, in 
 
 self._caller = lambda f: f()
   File "/home/paolo/Dropbox/git/web2py/gluon/tools.py", line 2935, in f
 return action(*a, **b)
   File 
 "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
 , line 35, in modal
 d = {'form':club_form(c_id=club_id)}
   File 
 "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
 , line 103, in club_form
 if form.process(dbio=False).accepted:
   File "/home/paolo/Dropbox/git/web2py/gluon/html.py", line 2179, inprocess
 self.validate(**kwargs)
   File "/home/paolo/Dropbox/git/web2py/gluon/html.py", line 2118, 
 invalidate
 if self.accepts(**kwargs):
   File "/home/paolo/Dropbox/git/web2py/gluon/sqlhtml.py", line 1408, 
 i

[web2py] Re: wiki now partially documented

2012-12-27 Thread Alan Etkin

>
>  auth.extra_fields["wiki"]
>

Sorry, auth.settings.extra_fields["wiki_..."], you get the idea :P.

-- 





[web2py] Re: wiki now partially documented

2012-12-27 Thread Alan Etkin
El jueves, 27 de diciembre de 2012 17:40:39 UTC-3, Massimo Di Pierro 
escribió:
>
> Could you add a paragraph about resolve? I think you added the feature and 
> you can explain it better.
>

I'll send the chapter patch ASAP to add info about resolve=False and 
auth.extra_fields["wiki"], but I think they don't fit in an overview 
because they are a bit advanced (a mid newcomer is not likely to be playing 
with the wiki model), in fact it seems to me that there could be a chapter 
dedicated to markmin plus auth.wiki leaving just an intro in the overview 
for the sake of simplicity.

-- 





[web2py] book 5th ed. Need help

2012-12-27 Thread Massimo Di Pierro
I need help to redo all screenshots in the book using the latest web2py.

I am looking for a few volunteers. Almost all of the screenshots are in 
chapter 3, 7, and 9.

They should be done using Chrome without toolbars.
Here are current screenshots:
https://github.com/mdipierro/web2py-book/tree/master/sources/29-web2py-english/images
The new screenshots should have the same name and format.

If one of you wants to them all and can do in 3 days, send me an example of 
a couple of screenshots privately (to make sure they look good) and I will 
pay you $150 for all of them.

-- 





[web2py] Re: wiki now partially documented

2012-12-27 Thread Massimo Di Pierro
Could you add a paragraph about resolve? I think you added the feature and 
you can explain it better.

On Thursday, 27 December 2012 12:49:55 UTC-6, Alan Etkin wrote:
>
> > Also, is auth.wiki("_tag") a new feature? Does it replace the 
> auth.wiki("slug") argument or they are both supported?
>
> Sorry for posting back, but I found that both auth.wiki(slug) and 
> auth.wiki(_widget) are supported. Since the arg and kwarg notation is 
> possible, and the former is a bit simpler, I would add it to the examples.
>
> On missing parts, a further documentation might contain:
>
> - Complete .wiki() signature
> - Wiki model customization (resolve=False and extra fields) with examples
> - Using and subclassing the Wiki class for advanced customizations
>
>

-- 





[web2py] Re: delete uploads with SQLFORM.factory

2012-12-27 Thread Massimo Di Pierro
perhaps not the cause of the problem but

request.folder+'uploads/pictures'

should be

os.path.join(request.folder,'uploads','pictures')

On Thursday, 27 December 2012 00:30:00 UTC-6, Paolo wrote:
>
> Hi Massimo, 
> I've just tried to post and then edit with both SQLFORM.factory having  
> uploadseparate but nothing has changed. The problem is still there, 
> actually I am making explicitly inserts and  edits. 
> The whole SQLFORM.factory to edit a field is this:
> for field in ['title','description', 'user_contact','picture' 
> ]:
> db.club[field].default = club[field]
> for field in ['name']:
> db.cities[field].default = city[field]
> form = SQLFORM.factory(db.club, db.cities, _class='well', 
>formstyle='bootstrap', showid= False,
>upload=URL('default', 
> 'download'),uploadfolder
> =request.folder+'uploads/pictures',  
>uploadseparate=True, 
> autodelete=True,table_name
> ='club')
>
>
> Paolo
>
>
>
> On Thursday, December 27, 2012 12:47:19 AM UTC+1, Massimo Di Pierro wrote:
>>
>> Did you upload the file first and then add uploadseparate/uploadfolder?  
>>
>> On Wednesday, 26 December 2012 12:49:01 UTC-6, Paolo wrote:
>>>
>>> Hi all, 
>>> it seems to me that SQLFORM.factory doesn't honor the uploadseparate 
>>> option because I'am not able to delete the uploaded file with 
>>> SQLFORM.factory
>>>
>>> form = SQLFORM.factory(db.club, db.cities, _class='well', 
>>>formstyle='bootstrap', showid= False,
>>>upload=URL('default', 'download'), uploadfolder=
>>> request.folder+'uploads/pictures',  
>>>uploadseparate=True, autodelete=True, table_name=
>>> 'club'  )
>>>
>>>  
>>>
>>> The error:
>>> Enter code here...2012-12-26 19:38:07,728 - web2py - ERROR - Traceback 
>>> (most 
>>> recent call last):
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/restricted.py", line 212, 
>>> in restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
>>> , line 123, in 
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/globals.py", line 193, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/tools.py", line 2935, in f
>>> return action(*a, **b)
>>>   File 
>>> "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
>>> , line 35, in modal
>>> d = {'form':club_form(c_id=club_id)}
>>>   File 
>>> "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
>>> , line 103, in club_form
>>> if form.process(dbio=False).accepted:
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/html.py", line 2179, inprocess
>>> self.validate(**kwargs)
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/html.py", line 2118, invalidate
>>> if self.accepts(**kwargs):
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/sqlhtml.py", line 1408, 
>>> inaccepts
>>> source_file = open(f, 'rb')
>>> IOError: [Errno 2] No such file or directory: 
>>> '/home/paolo/Dropbox/git/web2py/applications/bikend/club.picture.a4bd97789f289bcc.6c6f676f322e706e67.png'
>>>
>>> It tries to remove the file in the wrong directory. The right one would 
>>> be:
>>> >> Show 
>>> original
>>>
>>

-- 





[web2py] Re: Encoding works on production but fails in development

2012-12-27 Thread Massimo Di Pierro
Thanks fixed in trunk.

On Thursday, 27 December 2012 13:01:11 UTC-6, Felipe Meirelles wrote:
>
> Hey hey, just solved it, if you can patch:
>
> dal.py line 4104:
>
> def connector(driver_args=driver_args):
> return rdbms.connect(charset='utf8', **driver_args)
>
> the credits goes to this post as in cloud sql documentation is never 
> mentioned this charset parameter to the development db:
>
> https://groups.google.com/forum/?fromgroups=#!search/cloud$20sql$20utf8/google-cloud-sql-discuss/cmmNTT1lJ18/ZBzmsYdcdNwJ
>
> Thanks all.
>
> On Thursday, December 27, 2012 4:47:08 PM UTC-2, Felipe Meirelles wrote:
>>
>> It also fails when rendering the grid, but again, only in development 
>> server, wich makes me think its something related to google sdk.
>> Is there some ideia?
>>
>> On Thursday, December 27, 2012 12:51:23 PM UTC-2, Felipe Meirelles wrote:
>>>
>>> I'm using GAE + Google Cloud SQL and when I insert some data to local 
>>> server with special chars like in "Água" it saves the data, but when i try 
>>> to retrieve it i get an encoding error from python.
>>> In production it is automaticaly encoded to \u00c1gua and saves to DB. 
>>> Is it some mysql feature that Google Cloud SQL has as default or some 
>>> diference in the implementation of the adapters?
>>>
>>> Thanks
>>>
>>

-- 





[web2py] Re: wiki now partially documented

2012-12-27 Thread Massimo Di Pierro
Thanks. Will do.

On Thursday, 27 December 2012 12:49:55 UTC-6, Alan Etkin wrote:
>
> > Also, is auth.wiki("_tag") a new feature? Does it replace the 
> auth.wiki("slug") argument or they are both supported?
>
> Sorry for posting back, but I found that both auth.wiki(slug) and 
> auth.wiki(_widget) are supported. Since the arg and kwarg notation is 
> possible, and the former is a bit simpler, I would add it to the examples.
>
> On missing parts, a further documentation might contain:
>
> - Complete .wiki() signature
> - Wiki model customization (resolve=False and extra fields) with examples
> - Using and subclassing the Wiki class for advanced customizations
>
>

-- 





[web2py] Re: delete uploads with SQLFORM.factory

2012-12-27 Thread Paolo
Hi, I thought about the option requires, right now I have:

requires=[IS_IMAGE(), IS_UPLOAD_FILENAME(extension='jpg|jpeg|png'), IS_IMAGE
(extensions=('jpeg', 'png'))
I thought that as defined, the field could not be empty, so, I tried to 
remove any constrain

requires=None
but then the delete button is no longer shown, why ?!
I've also tried:

requires=[]
but in this case I got the same error as in the other cases.

Paolo





On Thursday, December 27, 2012 7:30:00 AM UTC+1, Paolo wrote:
>
> Hi Massimo, 
> I've just tried to post and then edit with both SQLFORM.factory having  
> uploadseparate but nothing has changed. The problem is still there, 
> actually I am making explicitly inserts and  edits. 
> The whole SQLFORM.factory to edit a field is this:
> for field in ['title','description', 'user_contact','picture' 
> ]:
> db.club[field].default = club[field]
> for field in ['name']:
> db.cities[field].default = city[field]
> form = SQLFORM.factory(db.club, db.cities, _class='well', 
>formstyle='bootstrap', showid= False,
>upload=URL('default', 
> 'download'),uploadfolder
> =request.folder+'uploads/pictures',  
>uploadseparate=True, 
> autodelete=True,table_name
> ='club')
>
>
> Paolo
>
>
>
> On Thursday, December 27, 2012 12:47:19 AM UTC+1, Massimo Di Pierro wrote:
>>
>> Did you upload the file first and then add uploadseparate/uploadfolder?  
>>
>> On Wednesday, 26 December 2012 12:49:01 UTC-6, Paolo wrote:
>>>
>>> Hi all, 
>>> it seems to me that SQLFORM.factory doesn't honor the uploadseparate 
>>> option because I'am not able to delete the uploaded file with 
>>> SQLFORM.factory
>>>
>>> form = SQLFORM.factory(db.club, db.cities, _class='well', 
>>>formstyle='bootstrap', showid= False,
>>>upload=URL('default', 'download'), uploadfolder=
>>> request.folder+'uploads/pictures',  
>>>uploadseparate=True, autodelete=True, table_name=
>>> 'club'  )
>>>
>>>  
>>>
>>> The error:
>>> Enter code here...2012-12-26 19:38:07,728 - web2py - ERROR - Traceback 
>>> (most 
>>> recent call last):
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/restricted.py", line 212, 
>>> in restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
>>> , line 123, in 
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/globals.py", line 193, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/tools.py", line 2935, in f
>>> return action(*a, **b)
>>>   File 
>>> "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
>>> , line 35, in modal
>>> d = {'form':club_form(c_id=club_id)}
>>>   File 
>>> "/home/paolo/Dropbox/git/web2py/applications/bikend/controllers/club.py"
>>> , line 103, in club_form
>>> if form.process(dbio=False).accepted:
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/html.py", line 2179, inprocess
>>> self.validate(**kwargs)
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/html.py", line 2118, invalidate
>>> if self.accepts(**kwargs):
>>>   File "/home/paolo/Dropbox/git/web2py/gluon/sqlhtml.py", line 1408, 
>>> inaccepts
>>> source_file = open(f, 'rb')
>>> IOError: [Errno 2] No such file or directory: 
>>> '/home/paolo/Dropbox/git/web2py/applications/bikend/club.picture.a4bd97789f289bcc.6c6f676f322e706e67.png'
>>>
>>> It tries to remove the file in the wrong directory. The right one would 
>>> be:
>>> >> Show 
>>> original
>>>
>>

-- 





[web2py] Re: Modifying auth.navbar

2012-12-27 Thread Lamps902
Thanks, Anthony. Made the necessary changes.

-Lamps

On Thursday, December 27, 2012 6:51:01 AM UTC-8, Anthony wrote:
>
> if not auth.user:
> auth.navbar()[3]['_href'] = URL('register')
>
> auth.navbar() simply returns a SPAN object containing the navbar elements, 
> so it can be manipulated via the server-side 
> DOM
> .
>
> Anthony
>
> On Thursday, December 27, 2012 9:32:30 AM UTC-5, Lamps902 wrote:
>>
>> Hi, group. Is there a straightforward way to modify web2py's navbar? I 
>> would like to customize the default navbar so that it redirects to a custom 
>> 'register' function when that option is selected, keeping all other 
>> functionality as it is. Thanks!
>>
>

-- 





Re: [web2py] Re: Unable to set is_active=True when record_versioning is enabled

2012-12-27 Thread Derek
Well, if it is in fact an audit log, then you should never be able to 
undelete, because then your log can't be trusted. You should be able to 
clone a deleted record however.
If you are just using your auditing log like a recycle bin, then please 
name it as such.

I work in the healthcare industry, and we are very strict about what is an 
audit log and what is not - if it isn't logged, it didn't happen. The fact 
that a delete happened on a certain date, and an 'undelete' happened on 
another date tells me what information was visible to users during that 
time period. By 'undeleting' from the log, you are essentially changing 
history (which we all should know is impossible).

In any case, you can count this as a vote for not allowing undeletes by 
changing the is_active flag.


Thanks,
Derek Wilson

On Wednesday, December 26, 2012 10:02:38 PM UTC-7, Mandar Vaze wrote:
>
>
> On Wed, Dec 26, 2012 at 11:08 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> there is a ticket about. I understand the problem but there is a logic 
>> problem. if is_active=False with versioning it means the record was 
>> deleted. So the record is ignored. It should not be visible at all except 
>> for auditing purposes. Now you are trying to bring it back to life 
>> (undelete it). It is not 100% obvious to me what the right behavior is. 
>> Granted that the right behavior is incorrect. Should one be allowed to set 
>> is_active=True or should one be forced to create a new record?
>>
>
> Here is a use case :
>
> "Normal" user deletes a record, is_active is set to False. s/he and other 
> "normal" users can never *see* this record, obviously they can't even 
> attempt to undelete. For them the record is gone (they don't know whether 
> it was actually deleted from the DB or just marked as not active)
> But for whatever reason, they want the record back, may be it was deleted 
> by mistake (They meant to delete other record, not this one ... blah blah 
> ... You know how users are :) ) So they report/complain to the admin about 
> it.
>
> "Admin" user doesn't use normal interface, s/he uses "appadmin" interface 
> and see the records as seen in the DB. S/he thinks, "Oh, the record isn't 
> gone, just marked as not active. This makes my life easier. I'll just set 
> "is_active" to True, click submit. Oh, I see "done" that means now record 
> is visible to "normal" user as well. My job is done" But guess what, 
> is_active is still False. "Normal" user still can't see the record.
>
> I understand that it is NOT obvious whether to allow undelete or user must 
> create new record. But that isn't my problem.
> Problem is "done" flashed to the user. So "appadmin" user "thinks" that 
> this is allowed *and* assumes that is_active is now set to True, But it 
> is NOT.
>
> So if you decide that "undelete is NOT allowed" - Let user know that 
> clearly. "Done" usually indicates Success.
>
> If on the other hand, if you decide to "allow undelete" - well, then 
> is_active=True transaction needs to be committed to the DB before flashing 
> "done"
>
> -Mandar
>
> P.S: BTW, this isn't end-of-the-world scenario, I was able to set 
> "is_active=True" via mysql command prompt. But only because I rechecked the 
> record and realized that is_active is still False.
>  

-- 





[web2py] Re: Encoding works on production but fails in development

2012-12-27 Thread Felipe Meirelles
Hey hey, just solved it, if you can patch:

dal.py line 4104:

def connector(driver_args=driver_args):
return rdbms.connect(charset='utf8', **driver_args)

the credits goes to this post as in cloud sql documentation is never 
mentioned this charset parameter to the development db:
https://groups.google.com/forum/?fromgroups=#!search/cloud$20sql$20utf8/google-cloud-sql-discuss/cmmNTT1lJ18/ZBzmsYdcdNwJ

Thanks all.

On Thursday, December 27, 2012 4:47:08 PM UTC-2, Felipe Meirelles wrote:
>
> It also fails when rendering the grid, but again, only in development 
> server, wich makes me think its something related to google sdk.
> Is there some ideia?
>
> On Thursday, December 27, 2012 12:51:23 PM UTC-2, Felipe Meirelles wrote:
>>
>> I'm using GAE + Google Cloud SQL and when I insert some data to local 
>> server with special chars like in "Água" it saves the data, but when i try 
>> to retrieve it i get an encoding error from python.
>> In production it is automaticaly encoded to \u00c1gua and saves to DB. 
>> Is it some mysql feature that Google Cloud SQL has as default or some 
>> diference in the implementation of the adapters?
>>
>> Thanks
>>
>

-- 





[web2py] Re: wiki now partially documented

2012-12-27 Thread Alan Etkin
> Also, is auth.wiki("_tag") a new feature? Does it replace the 
auth.wiki("slug") argument or they are both supported?

Sorry for posting back, but I found that both auth.wiki(slug) and 
auth.wiki(_widget) are supported. Since the arg and kwarg notation is 
possible, and the former is a bit simpler, I would add it to the examples.

On missing parts, a further documentation might contain:

- Complete .wiki() signature
- Wiki model customization (resolve=False and extra fields) with examples
- Using and subclassing the Wiki class for advanced customizations

-- 





[web2py] Re: Encoding works on production but fails in development

2012-12-27 Thread Felipe Meirelles
It also fails when rendering the grid, but again, only in development 
server, wich makes me think its something related to google sdk.
Is there some ideia?

On Thursday, December 27, 2012 12:51:23 PM UTC-2, Felipe Meirelles wrote:
>
> I'm using GAE + Google Cloud SQL and when I insert some data to local 
> server with special chars like in "Água" it saves the data, but when i try 
> to retrieve it i get an encoding error from python.
> In production it is automaticaly encoded to \u00c1gua and saves to DB. Is 
> it some mysql feature that Google Cloud SQL has as default or some 
> diference in the implementation of the adapters?
>
> Thanks
>

-- 





Re: [web2py] background image not showing

2012-12-27 Thread Bruno Rocha
{{backimage = URL('static','images/logo1.png')}}


-- 





[web2py] background image not showing

2012-12-27 Thread António Ramos


this does not work

Hep

Thank you

-- 





Re: [web2py] Re: Heroku error: relation "auth_user" already exists

2012-12-27 Thread Alec Taylor
Thanks, deleting the database "addon" there and recreating it with
`heroku addons:add heroku-postgresql:dev` did the trick.

On Thu, Dec 27, 2012 at 6:11 PM, Massimo Di Pierro
 wrote:
> Don't do drop tables. You should be able to use the heorku interface to drop
> the db and make a new one.
>
> Massimo
>
>
> On Thursday, December 27, 2012 12:25:51 AM UTC-6, Alec Taylor wrote:
>>
>> Even on the welcome app, I get this error.
>>
>> As a last resort I even tried adding this to my db.py:
>>
>> for table_name in db.tables():
>> db[table_name].drop()
>>
>> db.commit()
>>
>> But that made no difference to the error.
>>
>> Here's the ticket: http://fiddle.jshell.net/dP5t9/show
>>
>> How do I get the db to work properly on heroku?
>>
>> Thanks for all suggestions,
>>
>> Alec Taylor
>
> --
>
>
>

-- 





Re: [web2py] Re: My experience with heroku... also: unable to get database connection

2012-12-27 Thread Alec Taylor
Thanks, that solved it

(Well that and my other thread on heroku DB)

On Thu, Dec 27, 2012 at 4:40 AM, Massimo Di Pierro
 wrote:
> Did you look at all into:
>
> https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-heroku.sh
> https://github.com/web2py/web2py/blob/master/gluon/contrib/heroku.py
>
> You must use db = get_db() not db=DAL() on heroku.
>
>
> On Wednesday, 26 December 2012 07:05:55 UTC-6, Alec Taylor wrote:
>>
>> Been using Red Hat OpenShift for 6-months now, but have been annoyed
>> with their lack of DNS. A or CNAMEs simply aren't the same.
>>
>> So today I thought to try with Heroku.
>>
>> Here's a step-by-step setup guide:
>>
>> 1. Follow these steps: https://devcenter.heroku.com/articles/quickstart
>> 2. Grab the version of web2py you want to use (I used trunk off of
>> github), cd into this directory
>> 3. echo web: python anyserver.py -s gunicorn -i 0.0.0.0 -p $PORT >
>> Procfile
>> 4. In this directory create a 'requirements.txt' file for pip, with
>> these contents:
>> web2py
>> gunicorn
>> psycopg2 # PostgreSQL
>> 5. Modify the db.py for your app(s) to:
>> if not request.env.web2py_runtime_gae:
>> ## if NOT running on Google App Engine use SQLite or other DB
>> db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
>> try: db = DAL(os.environ.get('DATABASE_URL'))
>> except: db = DAL('sqlite://storage.sqlite')
>> 6. git init && git add . && git commit -am "init"
>> 7. heroku create
>> Take not of your URL here
>> 8. git push heroku master
>>
>> For further information see:
>> https://devcenter.heroku.com/articles/python
>> https://devcenter.heroku.com/articles/procfile
>> http://blog.doersguild.com/post/35049380409/running-web2py-on-heroku #
>> Where I got most of this from :P
>>
>> My thoughts thus far:
>> - Good to see a newer version of python (2.7.2 vs OpenShifts': 2.6)
>> - Has a default AES256 bit protected DigiCert verified which is nice
>> to see; and stops me from doing any hacky workarounds to get admin
>> working on HTTP (like required with OpenShift)
>> - Don't need to enter my password everytime I push my changes (not
>> sure if I like this!)
>> - It uses an old version of pip (1.1)
>>
>> Problems:
>> Unable to get a database connection. The doersguild blog guide which I
>> followed (see link above) didn't work, because 'DATABASE_URL' isn't in
>> my environ.
>>
>> My environ contains:
>> {'LANG': 'en_US.UTF-8', 'LIBRARY_PATH': '/app/.heroku/vendor/lib',
>> 'SHLVL': '1', 'PYTHONPATH': '/app/', 'SERVER_SOFTWARE':
>> 'gunicorn/0.17.0', 'PYTHONHOME': '/app/.heroku/venv/', 'PORT': '[not
>> saying publicly]', 'PWD': '/app', 'PYTHONHASHSEED': '[not saying
>> publicly]', 'HOME': '/app', 'PATH':
>>
>> '/app/.heroku/venv/bin:/app/.heroku/venv/bin:/bin:/usr/local/bin:/usr/bin',
>> 'PYTHONUNBUFFERED': 'true', 'PS1':
>> '\\[\\033[01;34m\\]\\w\\[\\033[00m\\] \\[\\033[01;32m\\]$
>> \\[\\033[00m\\]', 'LD_LIBRARY_PATH': '/app/.heroku/vendor/lib', '_':
>> '/app/.heroku/venv/bin/python'}
>>
>> Hope you enjoy my guide and can help me edit it to make it work
>> properly; i.e.: with DB connection.
>>
>> All the best,
>>
>> Alec Taylor
>
> --
>
>
>

-- 





[web2py] Re: wiki now partially documented

2012-12-27 Thread Alan Etkin
> El jueves, 27 de diciembre de 2012 12:15:48 UTC-3, Massimo Di Pierro 
escribió:http://web2py.com/books/default/chapter
> /29/03#The-built-in-web2py-wiki

Great. Now we have a very detailed reference. What is missing (why you say 
it's partially documented)?

Also, is auth.wiki("_tag") a new feature? Does it replace the 
auth.wiki("slug") argument or they are both supported?

Thank you

-- 





[web2py] wiki now partially documented

2012-12-27 Thread Massimo Di Pierro
http://web2py.com/books/default/chapter/29/03#The-built-in-web2py-wiki

-- 





Re: [web2py] Re: register user agreement. How to?

2012-12-27 Thread Anthony
Try:

auth.settings.extra_fields['auth_user'] = [Field('confirm_agreement', 
'boolean',
default=False, label=A('Accept Agreement', ...),
requires=IS_NOT_EMPTY(error_message='You must accept the agreement.'))]

Anthony

On Thursday, December 27, 2012 9:49:57 AM UTC-5, Ramos wrote:
>
> Ok, but if i add required=True does not mean that the check has to be 
> checked!
>
>
>
> 2012/12/27 Anthony >
>
>> auth.settings.extra_fields['auth_user'] = [Field('confirm_agreement', 
>> 'boolean',
>>
>> default=False, label=A('Accept Agreement', ...))]
>
>
>

-- 





[web2py] Encoding works on production but fails in development

2012-12-27 Thread Felipe Meirelles
I'm using GAE + Google Cloud SQL and when I insert some data to local 
server with special chars like in "Água" it saves the data, but when i try 
to retrieve it i get an encoding error from python.
In production it is automaticaly encoded to \u00c1gua and saves to DB. Is 
it some mysql feature that Google Cloud SQL has as default or some 
diference in the implementation of the adapters?

Thanks

-- 





[web2py] Re: Modifying auth.navbar

2012-12-27 Thread Anthony
if not auth.user:
auth.navbar()[3]['_href'] = URL('register')

auth.navbar() simply returns a SPAN object containing the navbar elements, 
so it can be manipulated via the server-side 
DOM
.

Anthony

On Thursday, December 27, 2012 9:32:30 AM UTC-5, Lamps902 wrote:
>
> Hi, group. Is there a straightforward way to modify web2py's navbar? I 
> would like to customize the default navbar so that it redirects to a custom 
> 'register' function when that option is selected, keeping all other 
> functionality as it is. Thanks!
>

-- 





Re: [web2py] Re: register user agreement. How to?

2012-12-27 Thread António Ramos
Ok, but if i add required=True does not mean that the check has to be
checked!



2012/12/27 Anthony 

> auth.settings.extra_fields['auth_user'] = [Field('confirm_agreement',
> 'boolean',
>
> default=False, label=A('Accept Agreement', ...))]

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Anthony
*
db(db[tname].id  == rowid).select()

*or just:

db[tname](rowid)

Anthony

On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote:
>
>
> Wanted to avoid hard-coding table name in the following statement by using 
> var *tname*, but not successful: any tip pls?
> *db(db.tname.id == rowid).select*
>
> Thanks
>
> On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>>
>> gr8!
>> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>>
>> thanks very much!
>>
>> best regards
>>
>> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>>>
>>> Yes and No. You can get rows.colnames and they contain table names . 
>>> field name
>>>
>>> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:


 How can we get table name from ROWS object?

 Thanks

>>>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
*db(db[tname].id  == rowid).select*

On Thursday, 27 December 2012 08:35:55 UTC-6, at wrote:
>
>
> Wanted to avoid hard-coding table name in the following statement by using 
> var *tname*, but not successful: any tip pls?
> *db(db.tname.id == rowid).select*
>
> Thanks
>
> On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>>
>> gr8!
>> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>>
>> thanks very much!
>>
>> best regards
>>
>> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>>>
>>> Yes and No. You can get rows.colnames and they contain table names . 
>>> field name
>>>
>>> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:


 How can we get table name from ROWS object?

 Thanks

>>>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Alan Etkin
> El jueves, 27 de diciembre de 2012 11:35:55 UTC-3, at escribió:
> Wanted to avoid hard-coding table name in the following statement by 
using var *tname*, but not successful: any tip pls?
*> db(db.tname.id == rowid).select*

You mean you must get the Table object programatically?

tname = ""
table = db[tname]


-- 





Re: [web2py] Re: register user agreement. How to?

2012-12-27 Thread Anthony
You could make the label for the field a link that pops up the agreement in 
a separate window:

auth.settings.extra_fields['auth_user'] = [Field('confirm_agreement', 
'boolean',
default=False, label=A('Accept Agreement', ...))]

Anthony

On Thursday, December 27, 2012 9:07:01 AM UTC-5, Ramos wrote:
>
> Yes but how to add the agreement text for the user to read?
>
>
> 2012/12/27 Massimo Di Pierro >
>
>>
>> auth.settings.extra_fields['auth_user']=[Field('confirm_agreement','boolean',default=False)]
>>
>>
>> On Thursday, 27 December 2012 03:32:19 UTC-6, Ramos wrote:
>>>
>>> hello,
>>> what is the best way to add a user agreement checkbox (must be checked!) 
>>> when a user registers in an app?
>>>
>>> Thank you
>>>
>>>
>>> António
>>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] Re: register user agreement. How to?

2012-12-27 Thread Massimo Di Pierro
In the user.html page

{{if request.args(0)=='register':}}
the text of the agreement
{{pass}}



On Thursday, 27 December 2012 08:07:01 UTC-6, Ramos wrote:
>
> Yes but how to add the agreement text for the user to read?
>
>
> 2012/12/27 Massimo Di Pierro >
>
>>
>> auth.settings.extra_fields['auth_user']=[Field('confirm_agreement','boolean',default=False)]
>>
>>
>> On Thursday, 27 December 2012 03:32:19 UTC-6, Ramos wrote:
>>>
>>> hello,
>>> what is the best way to add a user agreement checkbox (must be checked!) 
>>> when a user registers in an app?
>>>
>>> Thank you
>>>
>>>
>>> António
>>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at

Wanted to avoid hard-coding table name in the following statement by using 
var *tname*, but not successful: any tip pls?
*db(db.tname.id == rowid).select*

Thanks

On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote:
>
> gr8!
> *tname,z=my_rows.colnames[0].split('.')* gave the desired table name
>
> thanks very much!
>
> best regards
>
> On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>>
>> Yes and No. You can get rows.colnames and they contain table names . 
>> field name
>>
>> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>>>
>>>
>>> How can we get table name from ROWS object?
>>>
>>> Thanks
>>>
>>

-- 





[web2py] Re: Get url of uploaded file

2012-12-27 Thread Anthony
Also, see this section: 
http://web2py.com/books/default/chapter/29/03#An-image-blog

Anthony

On Thursday, December 27, 2012 9:28:31 AM UTC-5, Paolo Caruccio wrote:
>
> Following code should work
>
> {{=URL('download', args=audio.filepath)}}
>
> Please read 
> http://web2py.com/books/default/chapter/29/04#URL
>   to 
> learn more about URL mapping. 
>
>
>
> Il giorno giovedì 27 dicembre 2012 13:03:07 UTC+1, Eduardo Costa Lopes ha 
> scritto:
>>
>> Hi folks,
>>
>> I need to know how can I pass the url of an uploaded file. I'm using 
>> jquery media to play mp3 or flv files and the code looks like this:
>>
>> 
>>
>> and the player is rendered by:
>>
>> $('a.media').media( { width: 300, height: 20 } );
>>
>>
>> The script is loaded correctly, but the href value it seems to be wrong. 
>> Any ideas?
>>
>> Thanks,
>> Eduardo Lopes.
>>
>>
>>

-- 





Re: [web2py] Re: select all fields except field "F1"

2012-12-27 Thread António Ramos
Thank you

2012/12/27 Anthony 

> or
>
> fields = [f for f in db.auth_user if f.name != 'first_name']
>
> If you just want to prevent that field from appearing in a form or grid,
> you can go ahead and include it in the query but set its readable and
> writable attributes to False.
>
> Anthony
>
>
> On Thursday, December 27, 2012 8:40:58 AM UTC-5, Niphlod wrote:
>>
>> all fields are stored into a "special" key named _fields on the table.
>> So, e.g., you could do (not tested)
>>
>> fields = [db.auth_user[f] for f in db.auth_user._fields if f !=
>> 'first_name']
>>
>> db(db.auth_user.id>0).select(***fields)
>>
>>
>>
>> to select all of them except 'first_name'
>>
>>
>>
>> Il giorno giovedì 27 dicembre 2012 13:52:53 UTC+1, Ramos ha scritto:
>>>
>>> how can i select all fields from a query except field "F1" using DAL?
>>>
>>> Thank you
>>> António
>>>
>>  --
>
>
>
>

-- 





[web2py] Modifying auth.navbar

2012-12-27 Thread Lamps902
Hi, group. Is there a straightforward way to modify web2py's navbar? I 
would like to customize the default navbar so that it redirects to a custom 
'register' function when that option is selected, keeping all other 
functionality as it is. Thanks!

-- 





[web2py] Re: select all fields except field "F1"

2012-12-27 Thread Anthony
or

fields = [f for f in db.auth_user if f.name != 'first_name']

If you just want to prevent that field from appearing in a form or grid, 
you can go ahead and include it in the query but set its readable and 
writable attributes to False.

Anthony

On Thursday, December 27, 2012 8:40:58 AM UTC-5, Niphlod wrote:
>
> all fields are stored into a "special" key named _fields on the table.
> So, e.g., you could do (not tested)
>
> fields = [db.auth_user[f] for f in db.auth_user._fields if f != 
> 'first_name']
>
> db(db.auth_user.id>0).select(*fields)
>
>
>
> to select all of them except 'first_name'
>
>
>
> Il giorno giovedì 27 dicembre 2012 13:52:53 UTC+1, Ramos ha scritto:
>>
>> how can i select all fields from a query except field "F1" using DAL?
>>
>> Thank you
>> António
>>
>

-- 





[web2py] Re: Get url of uploaded file

2012-12-27 Thread Paolo Caruccio
Following code should work

{{=URL('download', args=audio.filepath)}}

Please read 
http://web2py.com/books/default/chapter/29/04#URL
  to 
learn more about URL mapping. 



Il giorno giovedì 27 dicembre 2012 13:03:07 UTC+1, Eduardo Costa Lopes ha 
scritto:
>
> Hi folks,
>
> I need to know how can I pass the url of an uploaded file. I'm using 
> jquery media to play mp3 or flv files and the code looks like this:
>
> 
>
> and the player is rendered by:
>
> $('a.media').media( { width: 300, height: 20 } );
>
>
> The script is loaded correctly, but the href value it seems to be wrong. 
> Any ideas?
>
> Thanks,
> Eduardo Lopes.
>
>
>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
gr8!
*tname,z=my_rows.colnames[0].split('.')* gave the desired table name

thanks very much!

best regards

On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote:
>
> Yes and No. You can get rows.colnames and they contain table names . field 
> name
>
> On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>>
>>
>> How can we get table name from ROWS object?
>>
>> Thanks
>>
>

-- 





Re: [web2py] Re: register user agreement. How to?

2012-12-27 Thread António Ramos
Yes but how to add the agreement text for the user to read?


2012/12/27 Massimo Di Pierro 

>
> auth.settings.extra_fields['auth_user']=[Field('confirm_agreement','boolean',default=False)]
>
>
> On Thursday, 27 December 2012 03:32:19 UTC-6, Ramos wrote:
>>
>> hello,
>> what is the best way to add a user agreement checkbox (must be checked!)
>> when a user registers in an app?
>>
>> Thank you
>>
>>
>> António
>>
>  --
>
>
>
>

-- 





[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
Yes and No. You can get rows.colnames and they contain table names . field 
name

On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote:
>
>
> How can we get table name from ROWS object?
>
> Thanks
>

-- 





[web2py] Re: Installing the book as an app?

2012-12-27 Thread Massimo Di Pierro
You may not have python-git installed. Just download the book as a zip from 
githib and unzip it under applications.

On Thursday, 27 December 2012 07:34:01 UTC-6, Tim Richardson wrote:
>
> With trunk (Version 2.4.1 alpha.2 (2012-12-26 11:54:07) using rocket 
> server on OS X, I'm trying something I've never done before: installing an 
> app from a url. The app I want to install is 
> https://github.com/mdipierro/web2py-book
> I give it the application name 'book'.
>
> It fails with 
> Unable to install application "book"
>
> Python 2.7.3
> started with python web2py.py 
>

-- 





[web2py] Table Name from ROWS object

2012-12-27 Thread at

How can we get table name from ROWS object?

Thanks

-- 





[web2py] Re: No handlers could be found for logger "web2py"

2012-12-27 Thread Niphlod
do you have a file named logging.conf in the same folder where web2py.py or 
web2py.exe is ?

Il giorno giovedì 27 dicembre 2012 13:27:44 UTC+1, Ramos ha scritto:
>
> hello 
> im testing scheduler and it works but on the console "command line " i 
> keep getting the message
>
>
> *No handlers could be found for logger "web2py"*
>
> every time the task is run
>
> I'm using windows 7
>
> thank you
> António
>
>
>

-- 





[web2py] Re: enum datatype in table definition

2012-12-27 Thread Niphlod
Field('condition', requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater',
'IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In',
'NotIn','Found','NotFound']))



Il giorno giovedì 27 dicembre 2012 13:30:04 UTC+1, ajith c t ha scritto:
>
>
>
>  Field('condition', 
> enum('IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound'),
>  
> notnull=True), 
>
> the above syntax gives me error while defining the table in web2py.  how 
> can one specify an enum datatype in web2py table definition
>

-- 





[web2py] Re: register user agreement. How to?

2012-12-27 Thread Massimo Di Pierro
auth.settings.extra_fields['auth_user']=[Field('confirm_agreement','boolean',default=False)]

On Thursday, 27 December 2012 03:32:19 UTC-6, Ramos wrote:
>
> hello,
> what is the best way to add a user agreement checkbox (must be checked!) 
> when a user registers in an app?
>
> Thank you
>
>
> António
>

-- 





[web2py] Re: select all fields except field "F1"

2012-12-27 Thread Niphlod
all fields are stored into a "special" key named _fields on the table.
So, e.g., you could do (not tested)

fields = [db.auth_user[f] for f in db.auth_user._fields if f != 'first_name'
]

db(db.auth_user.id>0).select(*fields)



to select all of them except 'first_name'



Il giorno giovedì 27 dicembre 2012 13:52:53 UTC+1, Ramos ha scritto:
>
> how can i select all fields from a query except field "F1" using DAL?
>
> Thank you
> António
>

-- 





[web2py] Get url of uploaded file

2012-12-27 Thread Eduardo Costa Lopes
Hi folks,

I need to know how can I pass the url of an uploaded file. I'm using jquery 
media to play mp3 or flv files and the code looks like this:



and the player is rendered by:

$('a.media').media( { width: 300, height: 20 } );


The script is loaded correctly, but the href value it seems to be wrong. 
Any ideas?

Thanks,
Eduardo Lopes.


-- 





Re: [web2py] Re: Edit or delete not committing in sqlform.grid for custom query

2012-12-27 Thread Boris
I think delete is working without problems. I have found the way how to 
execute delete without the problems. The problem is how to parse delete 
action.

Currently URL for button ends with #null. This is URL I receive when point 
to Delete button:
https:///ssc/admin/admin_devices/5#null

but it should be:
https:///ssc/admin/admin_devices/5/delete/device/73

If I change callback URL to button URL I see URL correctly but warning 
("Are you sure ...?") is not showing any more.

I have reported issue http://code.google.com/p/web2py/issues/detail?id=1247

Boris

Dne četrtek, 27. december 2012 05:41:26 UTC+1 je oseba Mandar Vaze napisala:
>
>
>
> On Thu, Dec 27, 2012 at 5:18 AM, Massimo Di Pierro 
> 
> > wrote:
>
>> Can you please open a ticket about this?
>
>
> There is already one opened for this : 
> http://code.google.com/p/web2py/issues/detail?id=1234
> Unless your email was meant for Boris and his buttonurl code change. (It 
> it addresses same problem, so same issue can be used ?)
>
> -Mandar 
>  
>
>>
>> On Wednesday, 26 December 2012 13:40:15 UTC-6, BJ wrote:
>>>
>>> The problem is in sqlhtml.py
>>>
>>> In latest version from line 2293-2297 is following content:
>>>
>>> if deletable and (not callable(deletable) or deletable(row)):
>>> row_**buttons.append(gridbutton(
>>> '**buttondelete', 'Delete',
>>> ca**llback=url(args=['delete', tablename, id
>>> ]),
>>> de**lete='tr'))
>>>
>>> but it should be:
>>>
>>> if deletable and (not callable(deletable) or deletable(row)):
>>> row_buttons.append(gridbutton(
>>> 'buttondelete', 'Delete',
>>> buttonurl=url(args=['delete', tablename, 
>>> id]), <--- Missing line to define URL for Delete button
>>> callback=url(args=['delete', tablename, 
>>> id]), <--- We need this for warning message (I believe so?)
>>> delete='tr'))
>>>
>>> But we also need to update gridbutton function (line 1806) because we 
>>> need button URL and warning. I have tried to add "buttonurl" but now the 
>>> record is deleted even if I select "Cancel".
>>>
>>> I don't know how to fix this because I don't how to handle callback.
>>>
>>> Boris
>>>
>>>
>>> Dne sreda, 19. december 2012 17:23:18 UTC+1 je oseba Mandar Vaze 
>>> napisala:

 I know it is a tough one, but can you guess what "could" be the problem 
 ? As I mentioned, "explicitly" adding db.commit() helps "resolve" the 
 problem (Whether in gluon/sqlhtml.py or separately in my custom ondelete)

 Does that give you any hints ? I debugged but (obviously) couldn't find 
 the culprit.

 Any pointers on how to troubleshoot/debug this ? I think at least one 
 more person has similar problem (One that started this thread)
  

> Really not relevant all the modify_grid() part. That doesn't belong to 
> web2py, which you are addressing the bug to. 
>

 I know. But it was something different - so I thought it may be 
 relevant.
  

> Without the table model, all code is quite useless. We don't need your 
> app. Just *an* app showing the problem.
>

 Ahh, I see. Let me try to create that (app) 

 -Mandar

>>>  -- 
>>  
>>  
>>  
>>
>
>

-- 





[web2py] Installing the book as an app?

2012-12-27 Thread Tim Richardson
With trunk (Version 2.4.1 alpha.2 (2012-12-26 11:54:07) using rocket server 
on OS X, I'm trying something I've never done before: installing an app 
from a url. The app I want to install is 
https://github.com/mdipierro/web2py-book
I give it the application name 'book'.

It fails with 
Unable to install application "book"

Python 2.7.3
started with python web2py.py 

-- 





[web2py] select all fields except field "F1"

2012-12-27 Thread António Ramos
how can i select all fields from a query except field "F1" using DAL?

Thank you
António

-- 





[web2py] Official site quotes

2012-12-27 Thread Alan Etkin
I think this should be changed:

- Quotes by tech reviewers/users should take precedence over quotes by 
framework contributors/developers.
- "... it's 2011, not 1999 ..." has become outdated.

I know this are small details but this quotes are in the first page of the 
framework site with a big font.

-- 





[web2py] enum datatype in table definition

2012-12-27 Thread ajith c t


 Field('condition', 
enum('IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In','NotIn','Found','NotFound'),
 
notnull=True), 

the above syntax gives me error while defining the table in web2py.  how 
can one specify an enum datatype in web2py table definition

-- 





[web2py] No handlers could be found for logger "web2py"

2012-12-27 Thread António Ramos
hello
im testing scheduler and it works but on the console "command line " i keep
getting the message


*No handlers could be found for logger "web2py"*

every time the task is run

I'm using windows 7

thank you
António

-- 





[web2py] Web2py book 4th edition missing "from gluon.scheduler import Scheduler "

2012-12-27 Thread António Ramos
hello
i'm reading scheduler sample in book 4th edition
chapter 4.18.3 Scheduler (experimental)

the line
from gluon.scheduler import Scheduler


is missing from the example

Thank you

António

-- 





Re: [web2py] invalid function (appadmin/graph_model)

2012-12-27 Thread Massimiliano
You need to copy welcome/controller/appadmin.py and
welcome/view/appadmin.html in your app or create a new app so that you have
the new appadmin .

Ciao


On Thu, Dec 27, 2012 at 11:13 AM, António Ramos wrote:

> I have latest web2py with graph model but when i click the button i get
>
> invalid function (appadmin/graph_model)
>
> --
>
>
>
>



-- 
Massimiliano

-- 





[web2py] invalid function (appadmin/graph_model)

2012-12-27 Thread António Ramos
I have latest web2py with graph model but when i click the button i get

invalid function (appadmin/graph_model)

-- 





[web2py] register user agreement. How to?

2012-12-27 Thread António Ramos
hello,
what is the best way to add a user agreement checkbox (must be checked!)
when a user registers in an app?

Thank you


António

--