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
admin | |
[X] 0001_initial | |
someapp | |
[X] 0001_initial | |
[X] 0002_auto_20150701_1359 | |
[X] 0003_auto_20160427_0527 | |
api | |
(no migrations) | |
auth | |
[X] 0001_initial |
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
if not True: | |
print 'wow' | |
else: | |
print 'neat' | |
# neat | |
if not not True: | |
print 'wow' | |
else: | |
print 'neat' |
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
# ============================================================================= | |
# IMPORTS | |
# ============================================================================= | |
# Python | |
from __future__ import unicode_literals | |
from future_builtins import map, filter | |
# Django | |
from django.apps import apps | |
from django.contrib import admin |
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 io | |
from chardet import UniversalDetector | |
def get_file_encoding(file_path): | |
with io.open(file_path, 'rb') as f: | |
# If you're dealing with a large amount of text, you can call the Universal | |
# Encoding Detector library incrementally, and it will stop as soon as it | |
# is confident enough to report its results. | |
detector = UniversalDetector() |
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
# ============================================================================== | |
# IMPORTS | |
# ============================================================================== | |
# Django | |
from django.forms.fields import DateField, DateTimeField | |
# App | |
from .widgets import DatePickerWidget | |
__all__ = ('DatePickerDateField', 'DatePickerDateTimeField') |
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
# forms.py | |
from django.forms import ModelForm | |
from .models import SomeModel | |
SomeModelForm(ModelForm): | |
model = SomeModel | |
# views.py |