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.conf.urls import patterns, include, url | |
| from django.contrib import admin | |
| from timetracker import views | |
| admin.autodiscover() | |
| year = '(?P<year>\d{4})' | |
| month = '(?P<month>\d{1,2})' | |
| day = '(?P<day>\d{1,2})' |
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
| {% extends "base.html" %} | |
| {% block header %} | |
| <link href="{{ STATIC_URL }}calendar.css" type="text/css" | |
| rel="stylesheet" /> | |
| {% endblock header %} | |
| {% block content %} | |
| <table cellpadding="10"> | |
| <tr> |
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
| function ajaxCall(form) { | |
| var pre = "#" + form + "_"; | |
| var formData = { | |
| "form_type" : form, | |
| "entry_date" : $(pre + 'entrydate').val(), | |
| "start_time" : $(pre + 'starttime').val(), | |
| "end_time" : $(pre + 'endtime').val(), | |
| "daytype" : $(pre + 'daytype').val(), |
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
| @json_response | |
| def ajax_add_entry(request): | |
| ''' | |
| Adds a calendar entry asynchronously | |
| ''' | |
| # create objects to put our data into | |
| json_data = dict() |
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
| @json_response | |
| def ajax_add_entry(request): | |
| ''' | |
| Adds a calendar entry asynchronously | |
| ''' | |
| # create objects to put our data into | |
| json_data = dict() |
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
| /* | |
| all functions dealing with the calendar that aren't | |
| automatically created server-side. | |
| */ | |
| function addTimePicker(element, state) { | |
| /* |
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
| import urllib2 | |
| import subprocess | |
| for x in range(1000): | |
| try: | |
| urllib2.urlopen("http://localhost:8080/") | |
| subprocess.Popen(["python", r"C:\Documents and Settings\francea\Desktop\serverhammer.py"]) | |
| except Exception as e: | |
| print str(e) |
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
| def get_total_balance(self): | |
| """ | |
| Calculates the total balance for the user | |
| This is on the ORM's User model and is just called as | |
| >>>User_Object.get_total_balance() | |
| """ |
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
| $.ajax({ | |
| url: "/ajax/", | |
| data: formData, | |
| dataType: "json", | |
| success: function (data) { | |
| if (data.success === true) { | |
| $("#calendar-entry").fadeToggle("slow", function() { | |
| $("#calendar-entry").html(data.calendar); | |
| }); |
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
| def fade_callback(): | |
| $("#calendar-entry").html(data.calendar); | |
| def ajax_success(data): | |
| if data.success == True: | |
| $("#calendar-entry").fadeToggle("slow", fade_callback) | |
| $("#calendar-entry").fadeToggle("slow"); | |
| else: | |
| alert(data.error); |