[web2py] Re: Error when listing newly created database tables from appadmin

2013-03-24 Thread Alan Etkin

>
> Hi there,
>
> I've created 7 tables from my app and 2 of them cause error when to be 
> listed from Appadmin (/appadmin/select/db?query=db.t_leads.id>0). Don't 
> see anything particular in the table definition that may cause the problem. 
> Any help would be apprecicated.
>

I think the problem may not be about the table definitions, but about the 
data that DAL is trying to retrieve for the datetime type fields. Are you 
reading a database from another application?

I'd check that the values stored for the datetime fields have the proper 
format.

-- 

--- 
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: Error when listing newly created database tables from appadmin

2013-03-24 Thread Spring
Hello Alan,

Thanks for the reply. I noticed the common thing of the two error tables is 
that they're both referenced by some other tables while do not reference to 
any. Showing one of referencing table:

db.define_table('t_clients_in',
Field('f_account_id', type='reference t_accounts', 
  label=T('Account ID')),
Field('f_lead_id', type='reference t_leads',
  label=T('Lead ID')),
Field('f_status', type='string',
  label=T('Involvement Status')),
Field('f_sow', type='string',
  label=T('Scope of Work')),
Field('f_needs', type='list:string',
  label=T('Needs')),
#Field('f_last_update', type='datetime',
#  label=T('Last Update')),
Field('f_remarks', type='list:string',
  label=T('Remarks')),
auth.signature,
format='%(f_account_id)s',
migrate=settings.migrate)

I'm not sure if the table reference was used correctly in field definition.
Now I hashed out all datetime field definition because I found there was 
two fields of "modified_on" and "created_on" which i have no idea where 
they're from since I didn't define them...

One more question here is, for the above table "t_clients_in", the first 
two fields "f_account_id" and "f_lead_id" refer to another two tables 
respectively. When use "new record" in Appadmin, "f_account_id" is a 
fill-in while "f_lead_id" becomes a dropdown (which is good). I cannot see 
where the difference comes from. 

Thanks in advance.

Spring








> I think the problem may not be about the table definitions, but about the 
> data that DAL is trying to retrieve for the datetime type fields. Are you 
> reading a database from another application?
>
> I'd check that the values stored for the datetime fields have the proper 
> format.
>
>

-- 

--- 
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: Error when listing newly created database tables from appadmin

2013-03-24 Thread Spring
I think I kinda figured out the problem. The order of defining tables seems 
matter. Tables to be referenced need to be defined before the referencing 
tables. Guess it's a rookie mistake.

Spring

在 2013年3月25日星期一UTC+8上午9时13分56秒,Spring写道:
>
> Hello Alan,
>
> Thanks for the reply. I noticed the common thing of the two error tables 
> is that they're both referenced by some other tables while do not reference 
> to any. Showing one of referencing table:
>
> db.define_table('t_clients_in',
> Field('f_account_id', type='reference t_accounts', 
>   label=T('Account ID')),
> Field('f_lead_id', type='reference t_leads',
>   label=T('Lead ID')),
> Field('f_status', type='string',
>   label=T('Involvement Status')),
> Field('f_sow', type='string',
>   label=T('Scope of Work')),
> Field('f_needs', type='list:string',
>   label=T('Needs')),
> #Field('f_last_update', type='datetime',
> #  label=T('Last Update')),
> Field('f_remarks', type='list:string',
>   label=T('Remarks')),
> auth.signature,
> format='%(f_account_id)s',
> migrate=settings.migrate)
>
> I'm not sure if the table reference was used correctly in field definition.
> Now I hashed out all datetime field definition because I found there was 
> two fields of "modified_on" and "created_on" which i have no idea where 
> they're from since I didn't define them...
>
> One more question here is, for the above table "t_clients_in", the first 
> two fields "f_account_id" and "f_lead_id" refer to another two tables 
> respectively. When use "new record" in Appadmin, "f_account_id" is a 
> fill-in while "f_lead_id" becomes a dropdown (which is good). I cannot see 
> where the difference comes from. 
>
> Thanks in advance.
>
> Spring
>
>
>
>
>
>
>
>
>> I think the problem may not be about the table definitions, but about the 
>> data that DAL is trying to retrieve for the datetime type fields. Are you 
>> reading a database from another application?
>>
>> I'd check that the values stored for the datetime fields have the proper 
>> format.
>>
>>

-- 

--- 
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: Error when listing newly created database tables from appadmin

2013-03-25 Thread Alan Etkin

>
> I think I kinda figured out the problem. The order of defining tables 
> seems matter. Tables to be referenced need to be defined before the 
> referencing tables. Guess it's a rookie mistake.

 
I don't think it's a matter of table definition order. Maybe there aren't 
any referenced records in the table so the dropdown widget is not created.

About the modified_on created_on, web2py has some features that create 
tables under the hood, i.e., for record versioning. Perhaps you want to 
disable them at the model by changing the feature options (they are 
documented in the book)

-- 

--- 
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: Error when listing newly created database tables from appadmin

2013-03-25 Thread Cliff Kachinske
As I understand it, the table does not have to exist when using the 
'reference sometable' syntax.  Or anyway that's how it's supposed to work.

I'm not 100% confident in it, though so I always make it a practice to 
create the reference tables first.

On Monday, March 25, 2013 6:31:16 AM UTC-4, Alan Etkin wrote:
>
> I think I kinda figured out the problem. The order of defining tables 
>> seems matter. Tables to be referenced need to be defined before the 
>> referencing tables. Guess it's a rookie mistake.
>
>  
> I don't think it's a matter of table definition order. Maybe there aren't 
> any referenced records in the table so the dropdown widget is not created.
>
> About the modified_on created_on, web2py has some features that create 
> tables under the hood, i.e., for record versioning. Perhaps you want to 
> disable them at the model by changing the feature options (they are 
> documented in the book)
>
>

-- 

--- 
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: Error when listing newly created database tables from appadmin

2013-03-25 Thread Spring
Agree with it. According to my practice empty can table can be referenced 
and the dropdown list is created by without any item. By defining the 
referenced tables first does solve my problem.

在 2013年3月25日星期一UTC+8下午10时48分02秒,Cliff Kachinske写道:
>
> As I understand it, the table does not have to exist when using the 
> 'reference sometable' syntax.  Or anyway that's how it's supposed to work.
>
> I'm not 100% confident in it, though so I always make it a practice to 
> create the reference tables first.
>
> On Monday, March 25, 2013 6:31:16 AM UTC-4, Alan Etkin wrote:
>>
>> I think I kinda figured out the problem. The order of defining tables 
>>> seems matter. Tables to be referenced need to be defined before the 
>>> referencing tables. Guess it's a rookie mistake.
>>
>>  
>> I don't think it's a matter of table definition order. Maybe there aren't 
>> any referenced records in the table so the dropdown widget is not created.
>>
>> About the modified_on created_on, web2py has some features that create 
>> tables under the hood, i.e., for record versioning. Perhaps you want to 
>> disable them at the model by changing the feature options (they are 
>> documented in the book)
>>
>>

-- 

--- 
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: Error when listing newly created database tables from appadmin

2013-03-27 Thread Derek
Right, if you use the 'reference sometable' syntax, that will allow you to 
have tables reference something which doesn't exist yet. If you use the 
db.othertable format, then the othertable absolutely has to exist.

On Monday, March 25, 2013 7:48:02 AM UTC-7, Cliff Kachinske wrote:
>
> As I understand it, the table does not have to exist when using the 
> 'reference sometable' syntax.  Or anyway that's how it's supposed to work.
>
> I'm not 100% confident in it, though so I always make it a practice to 
> create the reference tables first.
>
> On Monday, March 25, 2013 6:31:16 AM UTC-4, Alan Etkin wrote:
>>
>> I think I kinda figured out the problem. The order of defining tables 
>>> seems matter. Tables to be referenced need to be defined before the 
>>> referencing tables. Guess it's a rookie mistake.
>>
>>  
>> I don't think it's a matter of table definition order. Maybe there aren't 
>> any referenced records in the table so the dropdown widget is not created.
>>
>> About the modified_on created_on, web2py has some features that create 
>> tables under the hood, i.e., for record versioning. Perhaps you want to 
>> disable them at the model by changing the feature options (they are 
>> documented in the book)
>>
>>

-- 

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