Auto-notify outside/API services when instance Updated - Best Practices?

2008-11-20 Thread John.R

I'm working with an Event Model that, when saved (and possibly when
updated) needs to run some custom Python code to notify some outside
APIs - Twitter, Pownce, Google Calendar for instance.

I know enough to implement Signals so that I don't have to code
anything into the Event model itself if we change or add APIs later -
but what's the best approach to this, when handling things like:

What if one of several APIs is unavailable for update?
Best way to keep track of that, and update only the correct ones
later?

-
My initial thinking is to create a related Model that will store
information in properties, like "was_twittered",
"x_service_was_notified" that has a OneToOne relationship with the
Event Model. Then in Signals I would create a new instance of that,
related to the Event being saved/updated, and call a method on it that
would attempt to contact any services that don't have their related
"x_was_notified" property set to True.

But then, what about later? What if one doesn't respond? How do I go
back and tell it to retry later? Use cron? Implement a Django-based
cron app? I'd like to self-contain as much as possible with this, so
as to Not Repeat Myself, and to not go one a "wild goose chase" if
something acts buggy later.

Any ideas?

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django development approach

2008-11-20 Thread John.R



On Nov 20, 3:54 pm, eldonp2 <[EMAIL PROTECTED]> wrote:
> I've spent some time getting comfortable with Django. I would like to
> try writing my first real app. I'd like to know whether I should go
> ahead to write everything from scratch, or whether...
> 1. Using pluggables can be easily integrated into an existing app
> 2. Whether it will be easy to change the look and feel (with CSS)
> afterwards. I want to concentrate on functionality right now.
> 3. Models, urls, views, forms and templates should be created as
> needed manually - and whether using a CMS would make this task easier.
>
> Thanks


It depends on what you want your First Real App to do. Check out as
many 'pluggables' as possible, but since you're coding, feel free to
code yourself, and see how you compare. Also check out Pinax, if
you're implementing any of the functionality that it brings as a base,
and you can build on top of that.

The look/feel is "no biggie". Django's template system, and it's
inheritance, makes doing that sort of thing super easy.

I'm sure others will have more to say than me.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---