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 Stars = (function() { | |
var stars = [], | |
csrfToken, | |
signedIn = !!$('starred-event').length, | |
function initialSync() { | |
$.getJSON($('starred-event').data('get')).then(function(response) { | |
if (response) { | |
csrfToken = response.csrf_token; |
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.contrib.auth.models import User | |
from airmozilla.starred.models import StarredEvent, Event | |
me=User.objects.get(email='lfresh@mozilla.com') | |
events = Event.objects.all().order_by('?')[:30] | |
for event in events: | |
StarredEvent.objects.create(user=me, event=event) | |
StarredEvent.objects.all().count() |
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.utils import timezone | |
from django.core.management.base import BaseCommand | |
from airmozilla.main.models import Event | |
from airmozilla.starred.models import StarredEvent, Event | |
class Command(BaseCommand): | |
args = "Something" | |
help = "This is a help string" | |
def create_event(self): |
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
airmozilla=# \d main_userprofile | |
Table "public.main_userprofile" | |
Column | Type | Modifiers | |
-------------+---------+--------------------------------------------------------------- | |
id | integer | not null default nextval('main_userprofile_id_seq'::regclass) | |
user_id | integer | not null | |
contributor | boolean | not null default false | |
Indexes: | |
"main_userprofile_pkey" PRIMARY KEY, btree (id) | |
"main_userprofile_user_id" btree (user_id) |
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
def assertRedirects(response, destination): | |
assert response.status_code == 302 | |
assert response['Location'] == destination | |
new_response = self.client.get(destination) | |
assert new_response.status_code == 200 |
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 Person(object): | |
def __init__(self, name): | |
self.name = name | |
class Student(Person): | |
def __init__(self, name, school): | |
Person.__init__(self, name) | |
self.school = school |
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
def validate_active(self, value): | |
if (value): | |
survey = self.model | |
if (survey.questions.count == 0): | |
raise forms.ValidationError( | |
"Unable to activate survey without questions") |
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
nosetests -x --verbosity=1 | |
Reusing old database "test_airmozilla". Set env var FORCE_DB=1 if you need fresh DBs. | |
Raven is not configured (logging is disabled). Please see the documentation for more information. | |
E | |
====================================================================== | |
ERROR: test_getuser_deleted (airmozilla.auth.tests.test_backend.TestBackend) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/lisa/Projects/airmozilla/airmozilla/airmozilla/auth/tests/test_backend.py", line 42, in test_getuser_deleted | |
user.delete() |
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
nosetests --verbosity=1 | |
Creating test database for alias 'default'... | |
Raven is not configured (logging is disabled). Please see the documentation for more information. | |
..................F................F...F..................................................No handlers could be found for logger "django.request" | |
......................................F.......................................................F........E.............................F.................................................................................................................F......F.................F.......................E.........................................................................................F...................... | |
====================================================================== | |
ERROR: test_event_duplication_with_curated_groups (airmozilla.manage.tests.views.test_events.TestEvents) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/lisa |
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
##This is from my home computer | |
$ bundle exec rake | |
bundle exec jekyll build | |
Configuration file: /Users/lisa/projects/ascendproject/_config.yml | |
Source: /Users/lisa/projects/ascendproject | |
Destination: /Users/lisa/projects/ascendproject/_site | |
Generating... | |
Build Warning: Layout 'none' requested in feed.xml does not exist. | |
done. |
NewerOlder