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
{ | |
"count": 2, | |
"next": null, | |
"previous": null, | |
"results": [ | |
{ | |
"id": 7, | |
"sequence_id": 7, | |
"sender_friend_id": 5, | |
"recipient_friend_id": 1, |
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 SubVenueModelTest(TestCase): | |
def test_create_subvenue_and_get_name(self): | |
location = create_location(2, "Test Location2") | |
venue = create_venue(name="Test_Venue2",location=location) | |
sport1 = create_sport("Test") | |
sub_venue = models.SubVenue() | |
sub_venue.venue=venue | |
sub_venue.name="Test Sub Venuexxx" | |
sub_venue.sports.add(sport1.id) | |
sub_venue.save() |
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 bash | |
# Update the apt repos. | |
sudo apt-get update | |
# Install required dev packages. | |
sudo apt-get install -y language-pack-en | |
sudo apt-get install -y python3-dev python-pip python-dev | |
# Install virtualenvwrapper |
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
apm install minimap |
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
apm install linter | |
apm install linter-pycodestyle |
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
apm install pretty-json |
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
atom . |
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 requests | |
TOKEN_ENDPOINT = 'http://127.0.0.1:8000/api/login/' | |
PROFILE_ENDPOINT = 'http://127.0.0.1:8000/api/profile/' | |
def get_token(email, password): | |
"""Retrieve the token for logging in user""" | |
data = {'username': email, 'password': password} | |
res = requests.post(TOKEN_ENDPOINT, data=data) |
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
function createStore(reducer, initialState) { | |
let state = initialState; | |
const listeners = []; | |
const subscribe = listener => listeners.push(listener); | |
const getState = () => state; | |
const dispatch = action => { | |
state = reducer(state, action); | |
listeners.forEach(l => l()); | |
}; |
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 put(self, request, pk=None): | |
"""Handle updating an object""" | |
return Response({'method': 'PUT'}) | |
def patch(self, request, pk=None): | |
"""Handle partial update of object""" | |
return Response({'method': 'PATCH'}) |
OlderNewer