Comments (7)
I think this is how fixed.
from django-fixture-magic.
The root of this issue lies in some backwards compatibility code in Django versions older than 1.10. They try to mimic some optparse
behaviour (which seemingly was the old argument parser) in regards to accepting positional arguments. This line is the culprit: https://github.com/django/django/blob/stable/1.9.x/django/core/management/base.py#L309
The issue is gone with Django 1.10+, compare this: https://github.com/django/django/blob/stable/1.10.x/django/core/management/base.py#L260
This behaviour conflicts with your id
argument because both use nargs='*'
. Only happens because your command overwrites the args
class attribute (I guess you did this to provide more helpful commandline descriptions?).
Two fixes come to mind:
- Do not overwrite the
args
attribute in theCommand
class. - Handle parser creation based on Django version and workaround the conflicting behaviour.
I will send you a pull request for the latter.
from django-fixture-magic.
@cb109 @davedash As far as I can tell, there isn't any reason to overwrite the args
attribute in the Command
class anymore. This is a relic of the 1.7 and earlier versions of Django. It's been completely removed from the docs for versions 1.8 and greater. Removing this line fixes this issue for Django 1.8 and 1.9:
from django-fixture-magic.
Sounds like the best solution to me if backwards compatibility is not of concern 👍
from django-fixture-magic.
Not really much of an issue. Anything earlier than Django 1.8 is no longer a supported version of Django anyway.
Django 1.7 has been unsupported since December of 2015.
https://www.djangoproject.com/download/
Since 1.8 is the active LTS release of Django, it makes sense for django-fixture-magic to support it.
from django-fixture-magic.
If someone can resolve the conflicts in #48 then I can merge this in and this might be closable.
from django-fixture-magic.
@davedash I have created a pull request that should resolve this. It's removing the args line since it's not needed and just creating issues in Django 1.8 and Django 1.9.
from django-fixture-magic.
Related Issues (20)
- Why you don't support Python3? HOT 5
- ImportError: cannot import name loading HOT 3
- Custom dump nested deps HOT 3
- unexpected keyword argument 'use_natural_foreign_keys' HOT 3
- Issue while dumping a single object HOT 3
- merge_fixtures is having some problem parsing parameters with Python 3 HOT 17
- dump_object args parsing problem
- merge_fixtures is having some problem parsing parameters HOT 1
- Pip installs wrong version from PyPi HOT 10
- dump_object fails on '*' HOT 2
- query using the call_command HOT 1
- merge_fixtures should write to stdout HOT 2
- 1146, "Table 'db.table_name' doesn't exist" - error HOT 1
- Could not dump objects until I modified dump_object.py as per comment HOT 1
- dump_object does not follow object relations HOT 5
- dump_object with query parameter throwing JSONDecodeError
- Is this project still being developed? HOT 4
- implement CI workflow to publish to pypi.
- Unable to dump BinaryField
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-fixture-magic.