This file contains hidden or 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
fg |
This file contains hidden or 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
$(document).ready(function() { | |
$('#button_or_other_element_id').click(function(){ | |
$('#div_id').toggle(); | |
}); | |
}); |
This file contains hidden or 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
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<a href="#" id="#toggle_button">Show/Hide</> | |
<center> | |
<table cellpadding='8px' cellspacing='0px' id="users_table"> |
This file contains hidden or 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
## models.py | |
class Photo(models.Model): | |
user = models.ForeignKey(User) | |
image = models.ImageField(upload_to=photo) | |
text = models.TextField(blank=True, null=True) | |
date_created = models.DateTimeField(auto_now_add=True) | |
is_deleted = models.BooleanField(default=False) | |
objects = PhotoManager() |
This file contains hidden or 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 -*- | |
from models import * | |
from django.contrib import admin | |
import multilingual | |
from multilingual.admin import MultilingualModelAdmin | |
class ContentAdmin(MultilingualModelAdmin): | |
use_prepopulated_fields = {"slug": ("name",)} | |
use_fieldsets = [ |
This file contains hidden or 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
<a href="#" onclick="return fb_login();" id="facebook">Login with facebook</a> | |
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script> | |
<script type="text/javascript"> | |
FB.init("{{ request.facebook.api_key }}", "{% url publicauth-facebook-xdreceiver %}"); | |
function fb_login() { | |
FB.Connect.requireSession(function(test) { | |
window.location = "{% url publicauth-complete 'facebook' %}?next={{ request.GET.next }}"; | |
}); |
This file contains hidden or 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 project.models import Category | |
>>> Category.objects.all() | |
[<Category: Test1>, <Category: test without projects>, <Category: dsfsdf>] | |
>>> Category.objects.filter(project=True).all() | |
[<Category: Test1>] |
This file contains hidden or 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
# -*- encoding: utf-8 -*- | |
from models import * | |
from annoying.functions import get_object_or_None | |
from comments.utils import load_comments_userdata | |
from django.contrib.auth.decorators import login_required | |
from django.contrib.admin.views.decorators import staff_member_required | |
from django.conf import settings | |
from django.core.urlresolvers import reverse |
This file contains hidden or 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
a = [('airport', u'аэропорт'), # Аэропорт | |
('showplace', u'достопримечательность'), # Достопримечательности | |
('conference',u'конференц-центр'), # Конференц-центры | |
('museum',u'музей'), # Музеи | |
('monument',u'памятник'), # Памятники | |
('landmark',u'ориентир'), # Ориентиры | |
('park',u'парк'), # Парки | |
('arena',u'стадион'), # Стадионы или арены | |
('arena',u'арена'), | |
('theater',u'театр')] |
This file contains hidden or 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
export WORKON_HOME=~/.envs | |
export PROJECT_HOME=$HOME/project | |
source /usr/local/bin/virtualenvwrapper.sh |
OlderNewer