Merge with byteflow-friends
authorYury Yurevich <the.pythy@gmail.com>
Fri Apr 10 20:04:46 2009 +0700 (2 weeks ago)
changeset 1401af14c5e3801a
parent 1394a14d66321d1a
parent 1400c57aa412859d
child 140301808c290b8a
Merge with byteflow-friends
apps/accounts/forms.py
apps/blog/admin.py
apps/blogroll/__init__.py
apps/blogroll/admin.py
apps/blogroll/models.py
apps/blogroll/relations.py
apps/blogroll/templatetags/__init__.py
apps/blogroll/templatetags/blogroll_extras.py
apps/blogroll/views.py
apps/friends/admin.py
apps/friends/management/__init__.py
apps/friends/management/commands/__init__.py
apps/friends/management/commands/sync_friends.py
apps/friends/managers.py
apps/friends/models.py
apps/nebula/models.py
       1 --- a/apps/accounts/forms.py	Fri Apr 10 20:02:10 2009 +0700
       2 +++ b/apps/accounts/forms.py	Fri Apr 10 20:04:46 2009 +0700
       3 @@ -141,8 +141,6 @@
       4          Subscription.objects.filter(user=olduser).update(user=newuser)
       5          from openidconsumer.models import UserAssociation
       6          UserAssociation.objects.filter(user=olduser).update(user=newuser)
       7 -        from blogroll.models import Link
       8 -        Link.objects.filter(user=olduser).update(user=newuser)
       9  
      10          """Switch the user itself"""
      11          login(self.request, newuser)
     1.1 --- a/apps/blog/admin.py	Fri Apr 10 20:02:10 2009 +0700
     1.2 +++ b/apps/blog/admin.py	Fri Apr 10 20:04:46 2009 +0700
     1.3 @@ -1,11 +1,11 @@
     1.4  from django.contrib import admin
     1.5  from django.contrib.auth.models import User
     1.6  from django.conf import settings
     1.7 -
     1.8 +from lib import libadmin
     1.9  from blog.models import Post
    1.10  
    1.11  
    1.12 -class PostAdmin(admin.ModelAdmin):
    1.13 +class PostAdmin(libadmin.BFAdmin):
    1.14      prepopulated_fields = {'slug': ('name', )}
    1.15      list_display = ('name', 'date', 'author', 'enable_comments', 'comments_open', 'is_draft', 'site', 'view_link')
    1.16      search_fields = ('name', 'text')
    1.17 @@ -24,24 +24,4 @@
    1.18          if settings.RENDER_METHOD in ('html', 'markdown', 'rst'):
    1.19              js = (settings.STATIC_URL + 'js/postimage.js', )
    1.20  
    1.21 -    def queryset(self, request):
    1.22 -        qs = super(PostAdmin, self).queryset(request)
    1.23 -        if not request.user.is_superuser:
    1.24 -            qs = qs.filter(author=request.user)
    1.25 -        return qs
    1.26 -
    1.27 -    def get_form(self, request, obj=None, **kwargs):
    1.28 -        '''
    1.29 -        Overwrite get_form to select the currently logged in user as the author
    1.30 -        '''
    1.31 -        form = super(PostAdmin, self).get_form(request, obj, **kwargs)
    1.32 -        f = form.base_fields['author']
    1.33 -        f.initial = request.user.pk
    1.34 -        if request.user.is_superuser:
    1.35 -            f.queryset = User.objects.filter(is_staff=True)
    1.36 -        else:
    1.37 -            f.queryset = User.objects.filter(pk=request.user.pk)
    1.38 -        form.base_fields['site'].initial = settings.SITE_ID
    1.39 -        return form
    1.40 -
    1.41  admin.site.register(Post, PostAdmin)
     2.1 --- a/apps/blog/templatetags/sidebar.py	Fri Apr 10 20:02:10 2009 +0700
     2.2 +++ b/apps/blog/templatetags/sidebar.py	Fri Apr 10 20:04:46 2009 +0700
     2.3 @@ -4,16 +4,13 @@
     2.4  from discussion.models import CommentNode
     2.5  from blog.models import Post
     2.6  from lib.db import load_content_objects
     2.7 -#from blogroll.models import Link
     2.8  
     2.9  register = Library()
    2.10  
    2.11  @register.inclusion_tag('blog/sidebar.html', takes_context=True)
    2.12  def sidebar(context):
    2.13      comments = CommentNode.objects.filter(approved=True).select_related().order_by('-pub_date')[:5]
    2.14 -    #comments = load_content_objects(comments, cache_field='object')
    2.15      last_posts = Post.objects.all().order_by('-date')[:5]
    2.16 -    #blogroll_links = Link.objects.all()
    2.17      # TODO: return all variables from RequestContext dictionary
    2.18      return {
    2.19              'STATIC_URL': context['STATIC_URL'],
    2.20 @@ -21,5 +18,4 @@
    2.21              'last_posts': last_posts,
    2.22              'settings': context['settings'],
    2.23              'comments': comments,
    2.24 -            #'blogroll_links': blogroll_links,
    2.25              }
     3.1 --- a/apps/friends/__init__.py	Fri Apr 10 20:02:10 2009 +0700
     3.2 +++ b/apps/friends/__init__.py	Fri Apr 10 20:04:46 2009 +0700
     3.3 @@ -7,35 +7,6 @@
     3.4   1. Copy nebula and friends apps to byteflow appsdir.
     3.5   2. Add this apps to ADDITONAL_APPS in settings_local.py:
     3.6     * nebula
     3.7 -   * blogroll
     3.8     * friends
     3.9   3. Run 'manage.py syncdb'
    3.10 -
    3.11 -Usage
    3.12 -=====
    3.13 -
    3.14 -0. If you already use Blogroll app, you need to synchronize your blogroll
    3.15 -with Friends. Just run 'manage.py sync_friends'. Then check feed urls (step 2)
    3.16 -and fetch them (step 3).
    3.17 -
    3.18 -1. Friends uses Blogroll as source of friend list. So you just need to add
    3.19 -Blogroll Link at admin interface if you want to add a friend.
    3.20 -
    3.21 -2. Blogroll link has no feed url, so Friends try to auto discover it. This may
    3.22 -end with incorrect result (for example, blog has feeds for posts and for comments,
    3.23 -and while you'd like to subscribe to posts, Friends has discovered comments feed)
    3.24 -or with no result at all.
    3.25 -
    3.26 -This
    3.27 -process may have no correct result (for example, blog have feed for comments
    3.28 -and for posts and you want to subscribe to posts feed, but Friends discovers
    3.29 -comments feed) or no result in general. So you need to check discovered feeds
    3.30 -in admin interface at Friends->Friend blogs.
    3.31 -
    3.32 -3. Fetch feeds. 
    3.33 - a) Use 'manage.py fetch_feeds friends' (you may want to put it in crontab)
    3.34 - b) Click to 'Fetch feeds manually' link at friends page
    3.35 -    (http://your.blog/friends/), this link is shown only for superusers.
    3.36 -
    3.37 -4. Have fun ;)
    3.38  """
     4.1 --- a/apps/friends/admin.py	Fri Apr 10 20:02:10 2009 +0700
     4.2 +++ b/apps/friends/admin.py	Fri Apr 10 20:04:46 2009 +0700
     4.3 @@ -1,11 +1,25 @@
     4.4 +from django.utils.translation import ugettext_lazy as _
     4.5  from django.contrib import admin
     4.6 -
     4.7 +from lib import libadmin
     4.8  from friends.models import FriendBlog
     4.9  
    4.10  
    4.11 -class FriendBlogAdmin(admin.ModelAdmin):
    4.12 -    list_display = ('name', 'feed', 'active', 'bad_dates', 'bad_tags', )
    4.13 -    search_fields = ('name', 'feed',)
    4.14 -    exclude = ('name', 'link', )
    4.15 +class FriendBlogAdmin(libadmin.BFAdmin):
    4.16 +    prepopulated_fields = {'slug': ('name', )}
    4.17 +    list_display = ('name', 'feed', 'link', 'active')
    4.18 +    search_fields = ('name', 'feed', 'link')
    4.19 +    exclude = ('etag', 'bad_dates', 'bad_tags', 'target', )
    4.20 +    fieldsets = (
    4.21 +        (None, {'fields': ('link', 'name', 'slug', 'feed')}),
    4.22 +        (_('Extra'), {'classes': ('collapse',), 
    4.23 +                      'fields': ('active', 'weight',)}),
    4.24 +        (_('Multiuser/multisite support'), {'classes': ('collapse',),
    4.25 +                                            'fields': ('author', 'site',)}),
    4.26 +        (_('Relations'), {'classes': ('collapse',),
    4.27 +                          'fields': ('friendship_rel', 'physical_rel',
    4.28 +                                     'professional_rel', 'geographical_rel',
    4.29 +                                     'family_rel', 'romantic_rel',
    4.30 +                                     'identity_rel')}),
    4.31 +    )
    4.32  
    4.33  admin.site.register(FriendBlog, FriendBlogAdmin)
     5.1 --- a/apps/friends/managers.py	Fri Apr 10 20:02:10 2009 +0700
     5.2 +++ b/apps/friends/managers.py	Fri Apr 10 20:04:46 2009 +0700
     5.3 @@ -1,6 +1,5 @@
     5.4  # -*- encoding: utf-8 -*-
     5.5  from BeautifulSoup import BeautifulSoup
     5.6 -from blogroll.models import Link
     5.7  from nebula.managers import AggregatedBlogManager, AggregatedPostManager
     5.8  
     5.9  def shorten_body_filter(postdata, abstract_limit=3, symbols_limit=1500):
    5.10 @@ -31,33 +30,7 @@
    5.11  
    5.12  class FriendBlogManager(AggregatedBlogManager):
    5.13  
    5.14 -    def _sync_friend(self, blogroll_link):
    5.15 -        blog, created = self.get_query_set().get_or_create(
    5.16 -            blogroll_link=blogroll_link,
    5.17 -        )
    5.18 -        link_disabled = getattr(blogroll_link, 'disabled', False)
    5.19 -        need_save = False
    5.20 -        if not link_disabled != blog.active:
    5.21 -            need_save = True
    5.22 -            blog.active = not link_disabled
    5.23 -        if not created and blog.name != blogroll_link.name:
    5.24 -            need_save = True
    5.25 -            blog.name = blogroll_link.name
    5.26 -        if not created and blog.link != blogroll_link.url:
    5.27 -            need_save = True
    5.28 -            blog.link = blogroll_link.url
    5.29 -            # link is updated, also maybe need to update feed
    5.30 -            blog.feed = ''
    5.31 -        
    5.32 -        if created or need_save:
    5.33 -            blog.save()
    5.34 -
    5.35 -    def sync_with_blogroll(self):
    5.36 -        for bl_link in Link.objects.all():
    5.37 -            self._sync_friend(bl_link)
    5.38 -
    5.39      def fetch_feeds(self, queryset=None):
    5.40 -        self.sync_with_blogroll()
    5.41          super(FriendBlogManager, self).fetch_feeds(queryset, shorten_body_filter)
    5.42  
    5.43  class FriendPostManager(AggregatedPostManager):
     6.1 --- a/apps/friends/models.py	Fri Apr 10 20:02:10 2009 +0700
     6.2 +++ b/apps/friends/models.py	Fri Apr 10 20:04:46 2009 +0700
     6.3 @@ -1,11 +1,21 @@
     6.4  from django.db import models
     6.5  from nebula.models import AggregatedBlog, AggregatedPost
     6.6 -from blogroll.models import Link
     6.7  from friends.managers import FriendBlogManager, FriendPostManager
     6.8 -
     6.9 +from friends import relations as rels
    6.10 +from django.contrib.auth.models import User
    6.11 +from django.contrib.sites.models import Site
    6.12 +from django.utils.translation import ugettext_lazy as _
    6.13  
    6.14  class FriendBlog(AggregatedBlog):
    6.15 -    blogroll_link = models.ForeignKey(Link)
    6.16 +    weight = models.IntegerField(_('Weight'), blank=True, default=0, help_text=_(u'You can order links by this field. Link with smaller number goes first.'))
    6.17 +
    6.18 +    friendship_rel = models.CharField(_('Friendship relation'), max_length=20, choices=rels.FRIENDSHIP_REL, blank=True)
    6.19 +    physical_rel = models.CharField(_('Physical relation'), max_length=20, choices=rels.PHYSICAL_REL, blank=True)
    6.20 +    professional_rel =  models.CharField(_('Profesional relation'), max_length=20, choices=rels.PROFESSIONAL_REL, blank=True)
    6.21 +    geographical_rel = models.CharField(_('Geographical relation'), max_length=20, choices=rels.GEOGRAPHICAL_REL, blank=True)
    6.22 +    family_rel = models.CharField(_('Family relation'), max_length=20, choices=rels.FAMILY_REL, blank=True)
    6.23 +    romantic_rel = models.CharField(_('Romantic relation'), max_length=20, choices=rels.ROMANTIC_REL, blank=True)
    6.24 +    identity_rel = models.CharField(_('Identity relation'), max_length=20, choices=rels.IDENTITY_REL, blank=True)
    6.25      
    6.26      objects = FriendBlogManager()
    6.27      
    6.28 @@ -13,8 +23,6 @@
    6.29          return u"Friend: %s" % self.name
    6.30      
    6.31      def save(self, **kwargs):
    6.32 -        self.name = self.blogroll_link.name
    6.33 -        self.link = self.blogroll_link.url
    6.34          self.target = self.__class__._meta.app_label
    6.35          super(FriendBlog, self).save(**kwargs)
    6.36  
     7.1 --- a/apps/nebula/models.py	Fri Apr 10 20:02:10 2009 +0700
     7.2 +++ b/apps/nebula/models.py	Fri Apr 10 20:04:46 2009 +0700
     7.3 @@ -2,6 +2,8 @@
     7.4  from tagging.fields import TagField
     7.5  from django.utils.translation import ugettext_lazy as _
     7.6  from django.db.models import permalink
     7.7 +from django.contrib.auth.models import User
     7.8 +from django.contrib.sites.models import Site
     7.9  import datetime
    7.10  from nebula.debugging import *
    7.11  from pytils.translit import slugify
    7.12 @@ -11,16 +13,19 @@
    7.13  
    7.14  class AggregatedBlog(models.Model):
    7.15      """A blog or blog-like website run by an individual or corporation"""
    7.16 -    name = models.CharField(_('name'), blank=True, max_length=255)
    7.17 -    slug = models.SlugField(_('slug'), blank=True)
    7.18 -    link = models.URLField(blank=True, verify_exists=False)
    7.19 -    feed  = models.URLField(_('feed'), verify_exists=False, blank=True)
    7.20 -    owner = models.CharField(_('owner'), blank=True, max_length=100)
    7.21 -    active = models.BooleanField(_('active'), default=True)
    7.22 +    name = models.CharField(_('name'), blank=True, max_length=255, help_text=_("Name of the blogroll item"))
    7.23 +    slug = models.SlugField(_('slug'), blank=True, help_text=_("Slug, populates automatically from name"))
    7.24 +    link = models.URLField(_('link'), blank=False, verify_exists=False, help_text=_("Link to blog"))
    7.25 +    feed  = models.URLField(_('feed'), verify_exists=False, blank=True, help_text=_("Link to blog's feed, discovered automatically if not filled"))
    7.26 +    active = models.BooleanField(_('active'), default=True, help_text=_("Show item in blogroll"))
    7.27 +    
    7.28      bad_dates = models.BooleanField(_('bad dates'), default=False)
    7.29      bad_tags = models.BooleanField(_('no tags'), default=False)
    7.30      etag = models.CharField(_('etag'), blank=True, max_length=50)
    7.31      target = models.CharField(_('target app'), blank=True, max_length=50)
    7.32 +    
    7.33 +    site = models.ForeignKey(Site, related_name='nebula')    # multiside byteflow support
    7.34 +    author = models.ForeignKey(User, related_name='nebula')  # multiuser byteflow support
    7.35      
    7.36      objects = AggregatedBlogManager()
    7.37      
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/apps/friends/relations.py	Fri Apr 10 20:04:46 2009 +0700
     8.3 @@ -0,0 +1,40 @@
     8.4 +from django.utils.translation import ugettext_lazy as _
     8.5 +
     8.6 +FRIENDSHIP_REL = (
     8.7 +    ('contact', _('contact')),
     8.8 +    ('acquaintance', _('acquaintance')),
     8.9 +    ('friend', _('friend')),
    8.10 +)
    8.11 +
    8.12 +PHYSICAL_REL = (
    8.13 +    ('met', _('met')),
    8.14 +)
    8.15 +
    8.16 +PROFESSIONAL_REL = (
    8.17 +    ('co-worker', _('co-worker')),
    8.18 +    ('colleague', _('colleague')),
    8.19 +)
    8.20 +
    8.21 +GEOGRAPHICAL_REL = (
    8.22 +    ('co-resident', _('co-resident')),
    8.23 +    ('neighbor', _('neighbor')),
    8.24 +)
    8.25 +
    8.26 +FAMILY_REL = (
    8.27 +    ('child', _('child')),
    8.28 +    ('parent', _('parent')),
    8.29 +    ('sibling', _('sibling')),
    8.30 +    ('spouse', _('spouse')),
    8.31 +    ('kin', _('kin')),
    8.32 +)
    8.33 +
    8.34 +ROMANTIC_REL = (
    8.35 +    ('muse', _('muse')),
    8.36 +    ('crush', _('crush')),
    8.37 +    ('date', _('date')),
    8.38 +    ('sweetheart', _('sweetheart')),
    8.39 +)
    8.40 +
    8.41 +IDENTITY_REL = (
    8.42 +    ('me', _('me')),
    8.43 +)
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/apps/lib/libadmin.py	Fri Apr 10 20:04:46 2009 +0700
     9.3 @@ -0,0 +1,30 @@
     9.4 +from django.contrib import admin
     9.5 +from django.contrib.auth.models import User
     9.6 +from django.contrib.sites.models import Site
     9.7 +
     9.8 +class BFAdmin(admin.ModelAdmin):
     9.9 +    """
    9.10 +    Model admin with default values for site and author
    9.11 +    fields
    9.12 +    """
    9.13 +
    9.14 +    def queryset(self, request):
    9.15 +        qs = super(BFAdmin, self).queryset(request)
    9.16 +        if not request.user.is_superuser:
    9.17 +            qs = qs.filter(author=request.user)
    9.18 +        return qs
    9.19 +
    9.20 +    def get_form(self, request, obj=None, **kwargs):
    9.21 +        '''
    9.22 +        Overwrite get_form to select the currently logged in user as the author
    9.23 +        '''
    9.24 +        form = super(BFAdmin, self).get_form(request, obj, **kwargs)
    9.25 +        f = form.base_fields['author']
    9.26 +        f.initial = request.user.pk
    9.27 +        if request.user.is_superuser:
    9.28 +            f.queryset = User.objects.filter(is_staff=True)
    9.29 +        else:
    9.30 +            f.queryset = User.objects.filter(pk=request.user.pk)
    9.31 +        form.base_fields['site'].initial = Site.objects.get_current().pk
    9.32 +        return form
    9.33 +
    11.1 --- a/apps/blogroll/admin.py	Fri Apr 10 20:02:10 2009 +0700
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,9 +0,0 @@
    11.4 -from django.contrib import admin
    11.5 -
    11.6 -from blogroll.models import Link
    11.7 -
    11.8 -
    11.9 -class LinkAdmin(admin.ModelAdmin):
   11.10 -    list_display = ('name', 'url', 'relations', 'weight')
   11.11 -
   11.12 -admin.site.register(Link, LinkAdmin)
    12.1 --- a/apps/blogroll/models.py	Fri Apr 10 20:02:10 2009 +0700
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,61 +0,0 @@
    12.4 -"""
    12.5 -Django application that allows to create XFN-compatible block of links
    12.6 -"""
    12.7 -
    12.8 -from django.contrib.auth.models import User
    12.9 -from django.contrib.sites.models import Site
   12.10 -from django.db import models
   12.11 -from django.utils.translation import ugettext_lazy as _
   12.12 -
   12.13 -from lib.helpers import signals
   12.14 -from lib import appcheck
   12.15 -
   12.16 -from blogroll.relations import *
   12.17 -
   12.18 -
   12.19 -class Link(models.Model):
   12.20 -    user = models.ForeignKey(User, related_name='blogroll', blank=True, null=True)
   12.21 -    site = models.ForeignKey(Site, related_name='blogroll')
   12.22 -    url = models.URLField(_('URL'), verify_exists=False, blank=True)
   12.23 -    name = models.CharField(_('Name'), max_length=100, blank=True)
   12.24 -    relations = models.CharField(_('Relations'), max_length=100, blank=True, editable=False)
   12.25 -    weight = models.IntegerField(_('Weight'), blank=True, default=0, help_text=_(u'You can order links by this field. Link with smaller number goes first.'))
   12.26 -    disabled = models.BooleanField(_('Link is disabled'), default=False)
   12.27 -
   12.28 -    friendship_rel = models.CharField(_('Friendship relation'), max_length=20, choices=FRIENDSHIP_REL, blank=True)
   12.29 -    physical_rel = models.CharField(_('Physical relation'), max_length=20, choices=PHYSICAL_REL, blank=True)
   12.30 -    professional_rel =  models.CharField(_('Profesional relation'), max_length=20, choices=PROFESSIONAL_REL, blank=True)
   12.31 -    geographical_rel = models.CharField(_('Geographical relation'), max_length=20, choices=GEOGRAPHICAL_REL, blank=True)
   12.32 -    family_rel = models.CharField(_('Family relation'), max_length=20, choices=FAMILY_REL, blank=True)
   12.33 -    romantic_rel = models.CharField(_('Romantic relation'), max_length=20, choices=ROMANTIC_REL, blank=True)
   12.34 -    identity_rel = models.CharField(_('Identity relation'), max_length=20, choices=IDENTITY_REL, blank=True)
   12.35 -
   12.36 -    class Meta:
   12.37 -        ordering = ['weight']
   12.38 -        verbose_name = _('Link')
   12.39 -        verbose_name_plural = _('Links')
   12.40 -
   12.41 -    def __unicode__(self):
   12.42 -        return self.name
   12.43 -
   12.44 -    def save(self):
   12.45 -        """
   12.46 -        Cache all not empty relations in single relations field
   12.47 -        """
   12.48 -
   12.49 -        rels = ['friendship_rel', 'physical_rel', 'professional_rel',
   12.50 -                'geographical_rel', 'family_rel', 'romantic_rel', 'identity_rel']
   12.51 -        self.relations = ' '.join(filter(lambda x: x != '', [getattr(self, x) for x in rels]))
   12.52 -        if not self.name:
   12.53 -            self.name = self.user.name or self.user.username
   12.54 -
   12.55 -        if not self.url:
   12.56 -            self.url = self.user.site
   12.57 -
   12.58 -        super(self.__class__, self).save()
   12.59 -
   12.60 -if appcheck.friends:
   12.61 -    @signals.post_save(sender=Link)
   12.62 -    def sync_with_friend(instance, created, **kwargs):
   12.63 -        from friends.models import FriendBlog
   12.64 -        FriendBlog.objects._sync_friend(instance)
    13.1 --- a/apps/blogroll/relations.py	Fri Apr 10 20:02:10 2009 +0700
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,40 +0,0 @@
    13.4 -from django.utils.translation import ugettext_lazy as _
    13.5 -
    13.6 -FRIENDSHIP_REL = (
    13.7 -    ('contact', _('contact')),
    13.8 -    ('acquaintance', _('acquaintance')),
    13.9 -    ('friend', _('friend')),
   13.10 -)
   13.11 -
   13.12 -PHYSICAL_REL = (
   13.13 -    ('met', _('met')),
   13.14 -)
   13.15 -
   13.16 -PROFESSIONAL_REL = (
   13.17 -    ('co-worker', _('co-worker')),
   13.18 -    ('colleague', _('colleague')),
   13.19 -)
   13.20 -
   13.21 -GEOGRAPHICAL_REL = (
   13.22 -    ('co-resident', _('co-resident')),
   13.23 -    ('neighbor', _('neighbor')),
   13.24 -)
   13.25 -
   13.26 -FAMILY_REL = (
   13.27 -    ('child', _('child')),
   13.28 -    ('parent', _('parent')),
   13.29 -    ('sibling', _('sibling')),
   13.30 -    ('spouse', _('spouse')),
   13.31 -    ('kin', _('kin')),
   13.32 -)
   13.33 -
   13.34 -ROMANTIC_REL = (
   13.35 -    ('muse', _('muse')),
   13.36 -    ('crush', _('crush')),
   13.37 -    ('date', _('date')),
   13.38 -    ('sweetheart', _('sweetheart')),
   13.39 -)
   13.40 -
   13.41 -IDENTITY_REL = (
   13.42 -    ('me', _('me')),
   13.43 -)
    15.1 --- a/apps/blogroll/templatetags/blogroll_extras.py	Fri Apr 10 20:02:10 2009 +0700
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,29 +0,0 @@
    15.4 -from django import template
    15.5 -from django.db import connection
    15.6 -
    15.7 -from blogroll.models import Link
    15.8 -from discussion.models import CommentNode
    15.9 -
   15.10 -qn = connection.ops.quote_name
   15.11 -register = template.Library()
   15.12 -
   15.13 [email protected]_tag('blogroll/links.html')
   15.14 -def blogroll_links():
   15.15 -    """
   15.16 -    Include blogroll: list of links controlled from admin interface, including
   15.17 -    XFN information.
   15.18 -
   15.19 -    Renders 'blogroll/links.html' template at the point of inclusion.
   15.20 -    """
   15.21 -    query = """
   15.22 -    SELECT %(link)s.id FROM %(link)s
   15.23 -    ORDER BY %(link)s.weight""" % {
   15.24 -        'link': qn(Link._meta.db_table),
   15.25 -    }
   15.26 -    cursor = connection.cursor()
   15.27 -    cursor.execute(query)
   15.28 -    links = []
   15.29 -    for row in cursor.fetchall():
   15.30 -        links.append(Link.objects.get(id=row[0]))
   15.31 -    return {'links': links
   15.32 -            }
    16.1 --- a/apps/blogroll/views.py	Fri Apr 10 20:02:10 2009 +0700
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,1 +0,0 @@
    16.4 -# Create your views here.
    19.1 --- a/apps/friends/management/commands/sync_friends.py	Fri Apr 10 20:02:10 2009 +0700
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,11 +0,0 @@
    19.4 -import os
    19.5 -from django.core.management.base import NoArgsCommand
    19.6 -from friends.models import FriendBlog
    19.7 -
    19.8 -
    19.9 -class Command(NoArgsCommand):
   19.10 -    help = "Sync friends with blogroll"
   19.11 -
   19.12 -    def handle_noargs(self, **options):
   19.13 -        FriendBlog.objects.sync_with_blogroll()
   19.14 -