Here is my code:
wave_id, wavelet_id, blip_id exists and stored in database;
context.AddWave({'waveId': wave_id, 'waveletIds': [wavelet_id],})
collector_wave = context.GetWaveById(wave_id)
raw_collector_wavelet = collector_wave.CreateWavelet
(participants=context.GetRootWavelet().GetParticipants())
context.AddWavelet(raw_collector_wavelet)
collector_wavelet = context.GetWaveletById(wavelet_id=wavelet_id)
if not collector_wavelet:
return
blip = context.builder.BlipCreateChild(wave_id, wavelet_id,
blip_id)
context.AddBlip(blip)
blip = context.GetBlipById(blip['blipId'])
blip.GetDocument().SetText("New wave created")
causing:
Traceback (most recent call last):
context.AddWavelet(raw_collector_wavelet)
File "waveapi/ops.py", line 539, in AddWavelet
wavelet = OpBasedWavelet(wavelet_data, self)
File "waveapi/ops.py", line 127, in __init__
super(OpBasedWavelet, self).__init__(json)
File "waveapi/model.py", line 92, in __init__
self.creator = json.get('creator')
AttributeError: 'OpBasedWavelet' object has no attribute 'get'
Where is my mistake?
On 3 фев, 19:47, kyprizel <[email protected]> wrote:
> Thank you for your answer.
> Should I store all the existing wave/wavelet data, then construct it
> and add blip there? Or there is an easy way?
> What happen if Wavelet info changes while I'll add it from my storage
> to context?
>
> On 3 фев, 11:06, Stephen Gigante <[email protected]> wrote:
>
> > if you have the raw_data, use
> > context.AddWave(raw_data)
> > context.GetWaveById(waveid)
>
> > You'll need to manually add any waves, wavelets, and blips that you need
> > outside the original context before adding them.
>
> > This is (for reasons I don't quite understand), also necessary whenever you
> > use context.builder, which will give it's results as raw data.)
>
> > Hence my code looks like this:
> > d = context.builder.BlipCreateChild(blip.GetWaveId(), blip.GetWaveletId(),
> > blip.GetId())
> > context.AddBlip(d)
> > d = context.GetBlipById(d['blipId'])
>
> > - Stephen
>
> > On Wed, Feb 3, 2010 at 10:27 AM, kyprizel <[email protected]> wrote:
> > > Trying to store waves id and then add data to the wave after getting
> > > notices from another wave:
>
> > > old_wave = context.GetWaveById(wave_id=waveid)
> > > old_wave always returns None, I think b/c context is based on another
> > > wave.
> > > how can i access another wave from the current context? or should i
> > > use cron?
>
> > > Thank you.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Wave API" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-wave-api%[email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-wave-api?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-wave-api?hl=en.