justquick/django-activity-stream — Issue #74: Object must be a Django Model not ModelBase
Author: keithio
Created: 2012-03-02 09:01:12+00:00
State: open

I recently upgraded from django-activity-stream 0.3.9 to 0.4.0, and my code now raises the ModelNotActionable exception. I went through the code, but I cannot determine why this is happening. I am running Django 1.3.1. If this isn't a bug, any assistance would be greatly appreciated.

settings.py

...
ACTSTREAM_ACTION_MODELS = ['auth.User', 'item.Item']
...

view.py

from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from actstream.actions import follow
from actstream import action
from models import Item
from django.core.urlresolvers import reverse

def follow_item(request, item_id=None):
item = get_item_or_404(Item, id=item_id)
follow(request.user, item)
action.send(request.user, verb='is now following', target=item)
return HttpResponseRedirect(reverse('item', kwargs={'item_id': item_id}))

models.py

from django.db import models

class Item(models.Model):
title = models.CharField(max_length=140)

def __unicode__(self):
return self.title

@models.permalink
def get_absolute_url(self):
return ('item', kwargs={'item_id': str(self.id)})