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
if __name__ == "__main__": | |
reload(sys) | |
sys.setdefaultencoding("utf-8") | |
import csv | |
import urllib2 | |
import sys | |
from bs4 import BeautifulSoup | |
if __name__ == "__main__": | |
reload(sys) |
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
class Book(models.Model): | |
name = models.CharField(max_length= 200) | |
author = models.CharField(max_length=100) | |
publisher = models.CharField (max_length = 200) | |
class Chapter (models.Model): | |
book = models.ForeignKey(Book, related_name ='chapter') | |
title = models.CharField(max_length=300) | |
class Section (models.Model): |
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
class Book(models.Model): | |
name = models.CharField(max_length= 200) | |
author = models.CharField(max_length=100) | |
publisher = models.CharField (max_length = 200) | |
class Chapter (models.Model): | |
book = models.ForeignKey(Book, related_name ='chapter') | |
title = models.CharField(max_length=300) | |
class Section (models.Model): |
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 django.db import models | |
from phonenumber_field.modelfields import PhoneNumberField | |
from django.contrib.auth.models import ( | |
BaseUserManager, AbstractBaseUser | |
) | |
import hashlib, datetime, random | |
from datetime import date | |
from django import forms | |
from django.utils import timezone |
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 django.db import models | |
from django.contrib.auth.models import User | |
from clubs.models import Club | |
# Create your models here. | |
BOOKING_PERIOD = ( | |
("1", "Choose Booking Period"), |
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
<div class="row"> | |
<div class="col-md-4" ng-repeat="event in events.events"> | |
<div class="well"> | |
<div class="fb-profile"> | |
<img align="left" class="fb-image-lg" src="http://lorempixel.com/850/280/nightlife/5/" alt="Profile image example"/> | |
<div class="fb-profile-text" > | |
<h3> <a ng-click='redirect("/1971/events/event-details/" + event.id)'><strong>{[{event.event}]} </strong></a></h3> | |
<p class="help-block"> |
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
27.0.0.1 - - [09/Jan/2016 10:46:58] "POST /1971/employer/save_agency/ HTTP/1.1" 500 - | |
Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__ | |
return self.application(environ, start_response) | |
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__ | |
response = self.get_response(request) | |
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in get_response | |
response = self.handle_uncaught_exception(request, resolver, sys.exc_info()) | |
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 261, in handle_uncaught_exception | |
return debug.technical_500_response(request, *exc_info) |
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
class SaveAgencyList(APIView): | |
def get(self, request, format=None): | |
saved_agencies = SaveAgency.objects.filter(created_by=request.user).prefetch_related("saved_agency") | |
o = [] | |
for agency in saved_agencies: | |
agency_id = agency.saved_agency.id | |
try: | |
agency_query = Agency.objects.get(id=agency_id) | |
o = o + [agency_query] | |
except: |
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 django.db import models | |
from location.models import Location | |
from django.contrib.auth.models import User | |
# Create your models here. | |
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
class AgencyList(APIView): | |
def get(self, request, format=None): | |
search = request.GET.get("search", None) | |
address = request.GET.get("address", None) | |
search_label = request.GET.get("label", None) | |
print "Search label", search_label, search, address | |
""" | |
ServiceType | |
name=models.CharField(max_length=200, blank=True, null=True) | |
agencies = models.ManyToManyField(Agency) |
OlderNewer