-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log transitions #27
Comments
Hi Blackeagle52, I guess the problem is in your app_label. Are you defining the model Process in another Django module than testing_process? I guess your Process model is registered in the correct place, but the ProcessStateTransition model (which is dynamically generated), does not know that it should be registered in testing_process. Try adding the module where process is defined in, to the INSTALLED_APPS. If that's the case, I can easily write a patch for that. (but feel free to do it yourself. |
Nope, in my project there is only one model called Process, and it can be found in the module test_process. And this module is also already added to INSTALLED_APPS. INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'<appname>.testing_process',
'states2',
) Syncdb did create a Process table, with a field state, maybe I should mention this sooner. states2 works because of |
Your module is testing-process, while your app is test-process. It's best to be consistent. Is it working when you rename your python module? It is a bug nontheless (that the app label in the meta is not passed to the logging model) which I will fix asap. But I'm just wondering whether this is the cause and the above answer will resolve your issue. Cheers, |
Sorry, my module is also |
Can you check out the latest commit on the master branch of states2? It's this change: I did a test in my local setup, and it seemed to fix the issue. If it doesn't work, can you somehow create a zip file of your test project, and mail it to jonathan.slenders@mobilevikings.com |
Had a day off, so sorry for the delay, but I have good news;
Also the test succeeded. Thank you for your fast assistance! |
You're welcome! |
I am new to your product and I don't know if this is a issue within the documentation, my know-how of django or something else.
I am creating a class Process, which is a StateModel. Within this class I have a subclass, Machine(StateMachine). Within this class log_transitions is default True. See code below as current situation.
I am testing this class with the following lines
I get the following error; DatabaseError:
(1146, "Table 'testing_process.models_processstatelog' doesn't exist")
But when with
syncdb
the table isn't created. It isn't either shown withsqlall
. States2 is in my requirements.txt, placed within my setting in INSTALLED_APPS. I solved it temporary withlog_transitions = False
, but I ofcourse want to log my transitions.The text was updated successfully, but these errors were encountered: