The code I showed you is exactly how ads are created and stored in the
database. It is all through that code.

The code that updates the code uses cPickle.loads and treats it like a
python object updating the array then redumps it cPickle.dumps before
saving.

This is the exact same code I use in the other framework besides the web2py
insert method.

On Sun, Apr 15, 2012 at 9:33 PM, Anthony <[email protected]> wrote:

> I assume a Storage object got into some part of one of your ads objects
> somehow. How is the url object created? Aside from that insert code, is
> there any other code that updates the records?
>
>
> On Sunday, April 15, 2012 10:27:41 PM UTC-4, Bruce Wade wrote:
>>
>> url['id'] = integer
>> url['url'] = string
>>
>> On Sun, Apr 15, 2012 at 7:03 PM, Anthony <[email protected]> wrote:
>>
>>> And what are the index, url['id'], and url['url'] objects? Are any of
>>> them storage objects?
>>>
>>>
>>> On Sunday, April 15, 2012 8:19:45 PM UTC-4, Bruce Wade wrote:
>>>>
>>>>            ads = []
>>>>            if random_ads:
>>>>                 for index, url in enumerate(random_ads):
>>>>                     ads.append({
>>>>                         'index': index,
>>>>                         'id': url['id'],
>>>>                         'url': url['url'],
>>>>                         'valid': '',
>>>>                         'suburlcount': '',
>>>>                         'viewcanceled': '',
>>>>                         'timestart': '',
>>>>                         'timeend': '',
>>>>                         'rating': ''
>>>>                     })
>>>>             ads_to_view = cPickle.dumps(ads)
>>>>             #print "Unseen", len(ads)
>>>>             # Create todays ads to view
>>>>             self.db.viewedads.insert(**membe**r_id=member, date=date,
>>>> adsviewed=ads_to_view)
>>>>
>>>> On Sun, Apr 15, 2012 at 5:17 PM, Anthony <[email protected]> wrote:
>>>>
>>>>> What exactly did you save in the database?
>>>>>
>>>>>
>>>>> On Sunday, April 15, 2012 8:10:50 PM UTC-4, Bruce Wade wrote:
>>>>>>
>>>>>> Does web2py automatically save a cPickle in the database as
>>>>>> gluon.storage? Because I saved ads with the web2py framework, however now
>>>>>> when trying to load them with the old framework I get an error 
>>>>>> ImportError:
>>>>>> No module named gluon.storage when I don't use gluon at all in that old
>>>>>> framework.
>>>>>>
>>>>>> --
>>>>>> --
>>>>>> Regards,
>>>>>> Bruce Wade
>>>>>> http://ca.linkedin.com/in/**bruc****elwade<http://ca.linkedin.com/in/brucelwade>
>>>>>> http://www.wadecybertech.com
>>>>>> http://www.fittraineronline.**co****m<http://www.fittraineronline.com>- 
>>>>>> Fitness Personal Trainers Online
>>>>>> http://www.warplydesigned.com
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> --
>>>> Regards,
>>>> Bruce Wade
>>>> http://ca.linkedin.com/in/**bruc**elwade<http://ca.linkedin.com/in/brucelwade>
>>>> http://www.wadecybertech.com
>>>> http://www.fittraineronline.**co**m <http://www.fittraineronline.com>- 
>>>> Fitness Personal Trainers Online
>>>> http://www.warplydesigned.com
>>>>
>>>>
>>
>>
>> --
>> --
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/**brucelwade<http://ca.linkedin.com/in/brucelwade>
>> http://www.wadecybertech.com
>> http://www.fittraineronline.**com <http://www.fittraineronline.com> -
>> Fitness Personal Trainers Online
>> http://www.warplydesigned.com
>>
>>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.fittraineronline.com - Fitness Personal Trainers Online
http://www.warplydesigned.com

Reply via email to