This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import logging | |
import shutil | |
import sys | |
from time import time | |
from types import MethodType | |
from typing import Optional | |
from django.conf import settings | |
from django.db import DEFAULT_DB_ALIAS, connections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
How to update JSONField based on the value of another field. | |
For example: | |
class MyModel(models.Model): | |
name = models.CharField(...) | |
data = models.JSONField() | |
How to update the MyModel table to store the `name` field inside the `data` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"reactFunctionalComponentWithPropTypes": { | |
"prefix": "rfc", | |
"body": [ | |
"import React from \"react\";", | |
"import PropTypes from \"prop-types\";", | |
"", | |
"function ${1:${TM_FILENAME_BASE}}(props) {", | |
"\treturn (", | |
"\t\t<div>", |