Did you restart your terminal instance of web2py after change the type of
your field?

Models get load only when you start the session I think...

Richard


On Mon, May 5, 2014 at 3:51 PM, LoveWeb2py <[email protected]> wrote:

> When I connect to my table through python web2py.py -S myapp -M
>
> and type:
>
>
> users_list = db(db.users_id!=None).select()
>
> for row in users:
>  print row.address
>
> it shows truncated addresses in a list the first and last character are
> missing.
>
> When I click on the record in the grid, it shows the record spread out
> across 10 fields within the list for example: 123 home st. looks like
> 1
> 2
> 3
>
> h
> o
> m
> e
>
> s
> t
>
>
>
> On Monday, May 5, 2014 3:44:57 PM UTC-4, Richard wrote:
>
>> You have typo below :
>>
>> db.define_table('users',
>>             Field('address', *'*list:string')
>>
>> It truncate the end?
>>
>> How do you determine it is truncate? In the grid? If in grid() try to set
>> greater then 20 to maxtextlength parameters of the grid...
>>
>> Richard
>>
>>
>>
>>
>> On Mon, May 5, 2014 at 3:34 PM, LoveWeb2py <[email protected]> wrote:
>>
>>> Richard,
>>>
>>> My db.define_table('users',
>>>             Field('address',list:string')
>>>
>>> use to be Field('address','string')
>>>
>>> Soon as I changed it to list:string it truncated all of the addresses in
>>> the DAL. When I iterate through the database
>>>
>>> users_list = db(db.users_id!=None).select()
>>>
>>> for row in users:
>>>  print row.address
>>>
>>> brings back truncated addresses. Even if I switch the field back to
>>> string it still is truncated. However when I go to the database and look at
>>> the addresses they're not truncated at all.
>>>
>>>
>>> On Monday, May 5, 2014 2:32:16 PM UTC-4, Richard wrote:
>>>
>>>> Are you talking about field type or representation or requires that all
>>>> differents?
>>>>
>>>> Without code can't help...
>>>>
>>>> Sorry.
>>>>
>>>> Richard
>>>>
>>>>
>>>> On Mon, May 5, 2014 at 2:21 PM, LoveWeb2py <[email protected]> wrote:
>>>>
>>>>> I am using MYSQL. So it actually didn't affect the database itself.
>>>>> What it did was just change the way the data is represented in SQLFORM.
>>>>> Very interesting. How could I properly represent it?
>>>>>
>>>>>
>>>>> On Monday, May 5, 2014 2:11:28 PM UTC-4, Richard wrote:
>>>>>
>>>>>> If you didn't backup db before makee your change I guess no...
>>>>>>
>>>>>> Rollback as notting to do there, it is a migration matter and the way
>>>>>> web2py handle this process...
>>>>>>
>>>>>> If were create a new field, the old field would stay there, because
>>>>>> web2py migration don't delete field, but since you change field type,
>>>>>> web2py had try to make it best to handle the situation...
>>>>>>
>>>>>> Which DBMS do you use?
>>>>>>
>>>>>> If you have the data somewhere else, just reload them.
>>>>>>
>>>>>> Richard
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>  On Mon, May 5, 2014 at 2:02 PM, LoveWeb2py <[email protected]>wrote:
>>>>>>
>>>>>>> I had a list of addresses I was using on my user db and when I
>>>>>>> switched the field from string to string.list it truncated all of my
>>>>>>> values. I have over 1000 customers in there.
>>>>>>>
>>>>>>> Is there an explanation for this? It cut off the first and last
>>>>>>> character for example: 123 field road is now 23 field roa
>>>>>>>
>>>>>>> Is there any way to roll back???!
>>>>>>>
>>>>>>>  --
>>>>>>> Resources:
>>>>>>> - http://web2py.com
>>>>>>> - http://web2py.com/book (Documentation)
>>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "web2py-users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>  --
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "web2py-users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to