question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing target while using actor_stream

See original GitHub issue

hi. I’m expecting troubles with actor_stream(request.user).

for example:

from actstream.models import actor_stream, Action
print actor_stream(request.user)[0].target # returns None
print Action.objects.all()[0].target # returns Target object

BUT:

from actstream.models import actor_stream, Action
print request.user.actor_actions.all()[0].target  # returns Target object

User model - this is a custom user model, configured as described in djangoproject tutorial. Target model looks like this:

class Task(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    user = models.ForeignKey('core_auth.User', blank=True, null=True)
    ... < more fields >

Let me show you:

>>> from actstream.models import actor_stream, Action
>>> from core_auth.models import User
>>> u = User.objects.get(username='fynjah')
>>> actor_stream(u)[0].target # None
>>> x = actor_stream(u)[0]
>>> x
<Action: fynjah changed status DONE 58 minutes ago>
# BUT:
>>> x.target_content_type
<ContentType: Task>
>>> x.target
>>> x.target_object_id
u'f08ae5ab-8c07-4929-9021-62c867f0d081'
# AND:
>>> u.actor_actions.all()[0].target
<Task: wdstrm compositing>

What am i doing wrong :\

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
oaubertcommented, May 17, 2016

Same issue here, in the same context (using uuids as primary keys). This kind of issue is frequent in django extensions, uuids are not a smooth ride.

1reaction
cobyrne09commented, Jan 7, 2020

@auvipy Even though the change is made in Django, based on a brief look at the code, it appears as though the Action model would need to be changed to accomodate UUIDs. I ended up using UUID’s as secondary keys for my models, and having actstream hook up with my standard autoincrement pks. If you want to use UUID’s and actstream, this is probably the best you can do until the code fixes are in place. Unfortunately I am not competent enough to make said code changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

At least once guarantees of Producer.committableSink #1242
I was investigating missing messages where some messages in source topic was not available in target topic. On further investigation the ...
Read more >
trying to MarshalJSON an EnrichedActivity with the golang lib
I am trying to get the correct JSON from an enriched flat stream of enrichedActivites. The enrichedActvivites are stored correctly, I used ......
Read more >
akka/akka - Gitter
I'm streaming from S3 bucket to elasticsearch using AkkaStreams with Alpakka lib. When I have more than one file to process from S3...
Read more >
delaneyj1786/REINFORCINATOR source: R/funs.R - Rdrr.io
Documented in group_split_recounter group_splitter recounter Recounter2 ... remove missing values # behaviorstream <- ifelse(is.na(!!behaviorstream),0 ...
Read more >
StreamRefs - Reactive Streams over the network
Stream refs are trivial to use in existing clustered Akka applications and ... of the target side will fail, pointing out that the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found