google-code-export / django-syncr

Automatically exported from code.google.com/p/django-syncr
0 stars 0 forks source link

Youtube User Should have an (optional) relation to User #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think it would be useful to many people interested in django_syncr and
specifically it's youtube support, to link a YoutubeUser to a User.

I think a OneToOne Relation is probably the best way because presumably
each User would only have one youtube account. If you want to support
multiple youtube accounts per user, you can always Change the OneToOne to a
ForeignKey

Patch file attached (you may have to change the paths since the patch is in
the context of a pinax project)

Original issue reported on code.google.com by Jim.mixt...@gmail.com on 2 Oct 2009 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
example usage:
{{{

from django.contrib.auth.models import User
from syncr.app.youtube import YoutubeSyncr

user = User.objects.get(username='example_user')
yt_syncr = YoutubeSyncr()

yt_user = yt_syncr.syncUser('example_youtube_username')
yt_user.user = user
yt_user.save()

}}}

Original comment by Jim.mixt...@gmail.com on 2 Oct 2009 at 4:39

GoogleCodeExporter commented 9 years ago
here is another related patch that lets you sync all of a user's content in one 
line

example:
{{{

user.youtube_acct.sync()

}}}

Original comment by Jim.mixt...@gmail.com on 2 Oct 2009 at 5:05

Attachments:

GoogleCodeExporter commented 9 years ago
note: the second patch also contains the changes in the first patch

Original comment by Jim.mixt...@gmail.com on 2 Oct 2009 at 5:06

GoogleCodeExporter commented 9 years ago
Thanks for the patch! I feel bad about making a model change like this, but I 
think this is pretty useful and 
something kind of obvious that I missed originally, so I applied your changes 
this morning and credited you in 
the commit log. I'm trying to put together a catch-up release, since I've been 
neglecting this project for a while, 
so hopefully people can think of it as an upgrade. Thanks again!

Original comment by jesse.l...@gmail.com on 5 Dec 2009 at 8:13

GoogleCodeExporter commented 9 years ago
Happy to help!

PS - would you be interested in a photobucket syncr? I've finally figured out 
the
photobucket api  =D

Original comment by Jim.mixt...@gmail.com on 6 Dec 2009 at 12:15