Comments (8)
There is a design problem with django-fsm
It is good to have explicit fields declaration, and support for multiple state fields in the same model. but it makes hard to design how it should looks with inheritance and proxy models.
from django-fsm.
I'm hitting this same problem. Is there any way to get rid of those warnings? Are they coming from Django or FSM itself?
from django-fsm.
@andresdouglas The warning comes from django-fsm itself (see https://github.com/kmmbvnr/django-fsm/blob/master/django_fsm/db/fields/fsmfield.py#L117)
from django-fsm.
@kmmbvnr I've been wondering about this and trying a couple of things out, but have had no luck. My first thought was to try to switch the field
kwarg to being a string, and then using getattr(self, field)
inside inner_transition
, but that won't fly because we need to pass field
into FSMField() before then (https://github.com/kmmbvnr/django-fsm/blob/master/django_fsm/db/fields/fsmfield.py#L123).
The other thing I might try, in my app, is to monkey-patch the subclass to redeclare the field from the base class, but that may cause Django to cry - and wouldn't be a pretty fix. Will let you know if that at least works - if it does, perhaps making @transition
into a triple-nested decorator would work
from django-fsm.
Yep, think passing a string is a good and django-natural way to work on this issue, But some work on django-fsm internals need to be done. I have time now for doing that
from django-fsm.
Thanks @kmmbvnr, that's great to hear. If I can help, let me know.
from django-fsm.
I just started to learn generators and such today to try to have -fsm generating diagrams and ..._transitions... functions for proxies and inherited models.. Sadly python is not lisp (lol) and on top of that I have never created any own decorators so I'm on sketchy ground trying to figure things out. I mostly spent time learning about the basic python stuff so any pointers are welcome...
This is at least slightly related to this issue :) (I hope being quite drunk and all)
from django-fsm.
Inherited models drawing should works in version 2.0
from django-fsm.
Related Issues (20)
- State changing through a management command HOT 1
- Do there any blockers to bump new release? HOT 7
- How to handle `can_proceed(transition) == False` HOT 1
- Future support HOT 1
- auto-save workflow state HOT 8
- Support for Django 4.0 HOT 1
- documentation request HOT 1
- any new update in django-fsm HOT 1
- How can I have multiple workflows in the same template? HOT 4
- Question: How to resolve ConcurrentTransition(βCannot save object! The state has been changed since fetched from the database!β) issue ? HOT 1
- GitHub releases HOT 2
- Support for Django 4.0 when drawing transitions HOT 1
- graph_transitions: TypeError: expected string or bytes-like object HOT 3
- Update package to support Django 4 HOT 4
- No active CI for the builds HOT 7
- graph_transitions raise exception > TypeError: requires_system_checks must be a list or tuple HOT 6
- django_fsm.TransitionNotAllowed HOT 1
- Allowing incorrect state transitions HOT 3
- Releasing new version HOT 13
- Question: How to deal with async errors of side effects HOT 1
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-fsm.