just-work / django-celery-rpc

Remote access from one system to models of another one using Celery machinery.
The Unlicense
33 stars 13 forks source link

Call object method from pipe #35

Open voron3x opened 9 years ago

voron3x commented 9 years ago

Need something similar to:

p = cl.pipe()
p.filter('model', kwargs={'filters': {'active': True}})
p.method('deacivate', qs=True, args, kwargs)

if qs set then call queryset method, else on each model.

And:

p = cl.pipe()
p.create('model', data)
p.method('start_play', args, kwargs)
ttyS15 commented 9 years ago

Implementation must cover more generic cases:

an so on ...

ttyS15 commented 9 years ago

Some helpfull feature come with #40. Now symbol name can be attribute of module, class, objects and so on. It can be using for this task.

symbol_by_name():

https://github.com/ttyS15/django-celery-rpc/commit/5fe2a82973f088d5a3d4f08d96b388c5844010b3#diff-1c45146bb11f0dd8e4bfae77ba2e6593R27

Interesting usage - indirect addressing: model name is a value of symbol which is a attribute of field object of django model

https://github.com/ttyS15/django-celery-rpc/commit/5fe2a82973f088d5a3d4f08d96b388c5844010b3#diff-780d02bbe48e71ff1ceb6ca26995adbcR37