Comments (4)
Just to add my two cents; I only get this error when calling an actstream
event from within a management command. For some reason, in this case, when actstream
gets initialized, the models in the appcache are not yet properly loaded, and all references are just None
.
I could find a way to fix this from within the actstream package, but my current workaround involves reloading the MODELS
setting from within my management command:
class Command(NoArgsCommand):
...
def command(self, **kwargs):
import actstream.settings
actstream.settings.MODELS = {}
for model in getattr(settings, 'ACTSTREAM_ACTION_MODELS', ('auth.User',)):
actstream.settings.MODELS[model.lower()] = model = get_model(*model.split('.'))
...
This solves the problem completely. Adding a function to the actstream code that does exactly the same thing, and calling the function, however, did not work. Strange behavior, if you ask me. Any thoughts on how we can fix this in the actstream
code?
from django-activity-stream.
I've exactly the same problem...
from django-activity-stream.
fixed in v0.4.2
from django-activity-stream.
I use v0.4.5beta1 and have the same problem..
model not recognized when run from management command.
Actually out of my 4 models, 2 models are recognized and the other two are not.
And it works fine if run normally (not by management command)
from django-activity-stream.
Related Issues (20)
- Verb examples do not match spec
- django 4.0 support HOT 5
- django-activity-stream and django-comments-xtd HOT 2
- Activity Stream 2 JSON Feeds HOT 2
- AS2 paging
- DRF support HOT 3
- Use pluggy for customization report
- Installation breaks with pip -r HOT 2
- Django -activity stream HOT 1
- Missing migration when moving from Django 2.2 to 3.2 HOT 1
- Not working with Django 4.1 HOT 9
- Release new version HOT 1
- Filter user feed with distinct('action_object') HOT 1
- [Feature proposal] Delete Follow objects when the followed object is deleted? HOT 1
- Remove usage of `datetime_safe` HOT 4
- Field 'actor' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation. HOT 4
- [Feature request ] Soft delete for action
- Registering models from third-party apps HOT 1
- Make a 2.0 release and publish to PyPI HOT 4
- Add multidatabase support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-activity-stream.