rerss/feeds/views.py
def feed(request):
    """A view to support creating, modifying, and deleting feeds.

    RESTful: uses PUT to create, POST to edit, and DELETE to delete. Django's
    built-in syndication requires its own view, so GET is not implemented.

    """
    params = http.QueryDict(request.body, request.encoding)
    uid = users.get_current_user().user_id()
    if request.method == 'PUT':
        if db.Query(models.Feed).filter('link =', params['link']).count() == 0:
            f = models.Feed(link=params['link'], users=[uid], usercount=1)
            f.put()
            return feed_response(f)
        else:
            f = db.Query(models.Feed).filter('link =', params['link']).get()
            if uid in f.users:
                return http.HttpResponseNotModified()
            else:
                f.users.append(uid)
                f.usercount += 1
                f.put()
                return feed_response(f)
    elif request.method == 'POST':
        # Modify an existing Feed object.
        return http.HttpResponse(content='Not Implemented', status=501)
    elif request.method == 'DELETE':
        try:
            f = models.Feed.get_by_id(int(params['id']))
            f.users.remove(uid)
            f.usercount -= 1
            f.put()
            return feed_response(f)
        except ValueError:
            return http.HttpResponseBadRequest()
        except db.NotSavedError:
            return http.HttpResponseNotModified()
    else:
        return http.HttpResponseRedirect(urlresolvers.reverse('feeds'))
A view to support creating, modifying, and deleting feeds.

    RESTful: uses PUT to create, POST to edit, and DELETE to delete. Django's
    built-in syndication requires its own view, so GET is not implemented.

    
A view to support creating, modifying, and deleting feeds.
RESTful: uses PUT to create, POST to edit, and DELETE to delete. Django's
built-in syndication requires its own view, so GET is not implemented.
A view to support creating modifying and deleting feeds . RESTful : uses PUT to create POST to edit and DELETE to delete . Django ' s built - in syndication requires its own view so GET is not implemented .
def feed(request):
    params = http.QueryDict(request.body, request.encoding)
    uid = users.get_current_user().user_id()
    if request.method == 'PUT':
        if db.Query(models.Feed).filter('link =', params['link']).count() == 0:
            f = models.Feed(link=params['link'], users=[uid], usercount=1)
            f.put()
            return feed_response(f)
        else:
            f = db.Query(models.Feed).filter('link =', params['link']).get()
            if uid in f.users:
                return http.HttpResponseNotModified()
            else:
                f.users.append(uid)
                f.usercount += 1
                f.put()
                return feed_response(f)
    elif request.method == 'POST':
        return http.HttpResponse(content='Not Implemented', status=501)
    elif request.method == 'DELETE':
        try:
            f = models.Feed.get_by_id(int(params['id']))
            f.users.remove(uid)
            f.usercount -= 1
            f.put()
            return feed_response(f)
        except ValueError:
            return http.HttpResponseBadRequest()
        except db.NotSavedError:
            return http.HttpResponseNotModified()
    else:
        return http.HttpResponseRedirect(urlresolvers.reverse('feeds'))
def feed ( request ) : params = http . QueryDict ( request . body , request . encoding ) uid = users . get_current_user ( ) . user_id ( ) if request . method == 'PUT' : if db . Query ( models . Feed ) . filter ( 'link =' , params [ 'link' ] ) . count ( ) == 0 : f = models . Feed ( link = params [ 'link' ] , users = [ uid ] , usercount = 1 ) f . put ( ) return feed_response ( f ) else : f = db . Query ( models . Feed ) . filter ( 'link =' , params [ 'link' ] ) . get ( ) if uid in f . users : return http . HttpResponseNotModified ( ) else : f . users . append ( uid ) f . usercount += 1 f . put ( ) return feed_response ( f ) elif request . method == 'POST' : return http . HttpResponse ( content = 'Not Implemented' , status = 501 ) elif request . method == 'DELETE' : try : f = models . Feed . get_by_id ( int ( params [ 'id' ] ) ) f . users . remove ( uid ) f . usercount -= 1 f . put ( ) return feed_response ( f ) except ValueError : return http . HttpResponseBadRequest ( ) except db . NotSavedError : return http . HttpResponseNotModified ( ) else : return http . HttpResponseRedirect ( urlresolvers . reverse ( 'feeds' ) )
A view to support creating, modifying, and deleting feeds.
A view to support creating modifying and deleting feeds .
"""A view to support creating, modifying, and deleting feeds.

    RESTful: uses PUT to create, POST to edit, and DELETE to delete. Django's
    built-in syndication requires its own view, so GET is not implemented.

    """ # Modify an existing Feed object.
request