Comments (3)
If you're talking more about the undocumented deprecated transforms, I think django-codemod
doesn't handle them at the moment, I don't have any objections in adding them: they are mentioned in the release notes, which I think makes them candidate for inclusion. Pull request welcome.
If you're talking about JSONField
, that should be already covered by JSONModelFieldTransformer
:
django-codemod/django_codemod/visitors/postgres_fields.py
Lines 23 to 29 in 1983afd
But as you noted, the codemodder works only if imported as follow:
from django.contrib.postgres.fields import JSONField
It's true that the field may be imported from jsonb
module as well, but I'm not convinced that we should support it... I already identified an edge case if the parent module is imported (#63), but solving these 2 means we would have to support at least 4 different way of importing, and I could see this opening the door to more.
It would be simpler for now to just support one way and maybe never do #63. I like to think that in a near future, what is supported by django-codemod
would be enough of an incentive to import things in a predictable way: use documented imports and get the benefit of auto codemodding or do it yourself.
Probably an artifact of the way Pycharm offers imports.
Yes, I'm victim of this one myself, it sometimes suggest to import things from a module I already have in my imports, even if the thing is defined in a totally different location. A bit annoying.
from django-codemod.
Thanks for your reply.
I'm in two minds about these kind of edge cases of the undocumented kind.
But overall I think you are quite right in this case - support the typical and documented import. It does get caught by manage.py check
which means the deprecation doesn't get unreported.
from django-codemod.
Hum, I think we can leave this open to cover codemodding KeyTransform
and KeyTextTransform
... Unless they are already handled by django-codemod
(I really don't remember)?
from django-codemod.
Related Issues (20)
- iterable ConnectionHandler HOT 2
- Avoid try: .. except ImportError: blocks HOT 2
- Ability to use a specific codemodder to the CLI
- Merge test, lint and commitlint workflows HOT 3
- Add an option to skip paths (e.g. node_modules) HOT 8
- Recommended command recurses into my virtualenv HOT 1
- Extra imports added with libCST 0.3.14 and above HOT 2
- Attribute access to `url` incorrectly replaced
- Local variable shadowing import from outer scope HOT 1
- Action Required: Fix Renovate Configuration
- Switch to `version_toml` for semantic release HOT 2
- Simplify import checking with LibCST's FullyQualifiedNameProvider
- ParserSyntaxError when a module have a "from django.utils import timezone" import HOT 5
- Removed compatibility imports in 3.1
- Dependency Dashboard
- Option to show diffs HOT 1
- Django 4 django.dispatch.Signal unexpected keyword argument providing_args HOT 5
- ImportError on an Apple M1 Mac related to libcst HOT 5
- Add tests to sdist HOT 3
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-codemod.