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
from django.db import models | |
class ModelA(models.Model): | |
fieldA1 = models.CharField(max_length=100, unique=True) | |
fieldA2 = models.TextField(validators=[URLValidator()], blank=True, null=True) | |
fieldA3 = models.CharField(max_length=100, unique=True, null=True, blank=True) | |
field4 = models.BooleanField(default=True) | |
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 matplotlib.pyplot as plt | |
import numpy as np | |
def show_images(images, cols = 1, titles = None): | |
"""Display a list of images in a single figure with matplotlib. | |
Parameters | |
--------- | |
images: List of np.arrays compatible with plt.imshow. | |
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
# -*- coding: utf-8 -*- | |
import codecs | |
import cStringIO | |
import csv | |
import json | |
import sys | |
""" | |
Convert Django json datadump fields into csv. |
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
for remote in `git branch -r | grep -v master `; do git checkout --track $remote ; done |