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
# Defaultowe nazwy tabel: | |
# Code => <app>_code | |
# Kategories => <app>_kategories | |
# Code m2m to Kategories => <app>_code_kategorie | |
# Stworz nastepujaca migracje: | |
class Migration(SchemaMigration): | |
def forwards(self, orm): | |
db.add_column('<app>_code_kategorie', 'business_id', self.gf('django.db.models.fields.CharField')(max_length=100)) |
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
#!/usr/bin/env python | |
import os | |
import sys | |
if __name__ == "__main__": | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") | |
from django.core.management import execute_from_command_line | |
execute_from_command_line(sys.argv) |
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 confy | |
# 1 | |
with confy.loader(__file__) as confy: | |
locals().update(confy.merge( | |
confy.from_modules('base', confy.env('CONFIGURATION_MODE', 'development')), | |
confy.from_modules('local', silient=True), | |
confy.from_environ_vars([ | |
'DATABASE_HOST', |
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
# base.py | |
PROJECT_PATHS = confy.new( | |
root = confy.rootpath('..', '..'), | |
lock = "{root}/lockdir/", | |
tmp = "{root}/tmp/", | |
log = "{root}/log/", | |
static = "{root}/project/static/", | |
) | |
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 confy | |
with confy.loader(__file__) as confy: | |
MODE = confy.env('CONFIGURATION_MODE', 'gameapp/development') | |
locals().update(confy.from_modules({ | |
# GAME | |
'gameapp/development': 'default,gameapp/development', |
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
var notification = $('<div>') | |
.addClass('notification') .addClass(settings.type) | |
.append($('<div>').addClass('notification-image')) | |
.append($('<div class="notification-title">').html(text)); |
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
class Class(object): | |
def prop(self): | |
def fget(self): | |
# stuff to get the value | |
def fset(self, value): | |
# stuff to set the value | |
return locals() | |
prop = property(**prop()) |
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
var User = Class.$new(SuperType1, SuperType2, function (self, opts) { | |
self.name = opts.name; | |
self.lastname = opts.lastname; | |
}).classvars({ | |
classLevelVar: "Value" | |
}).def("fullName", function (self) { | |
return self.name + " " + self.lastname; |
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 os | |
def projectpath(*a): | |
from os.path import join, abspath | |
return join('/'.join(abspath(__file__).split('/')[0:-2]), *a) | |
files_base_names = [ | |
'default', | |
os.environ.get('DJANGO_ENV', 'dev'), | |
'local_settings' |
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
#!/usr/bin/env python | |
from django.core.management import execute_manager | |
try: | |
import settings | |
except ImportError, e: | |
import sys | |
sys.stderr.write( | |
"\n\n" | |
"Error: Can't find the file or directory 'settings' in the directory\n" |
NewerOlder