Skip to content

Instantly share code, notes, and snippets.

class PaymentSummaryViewSet(viewsets.ModelViewSet):
queryset = PaymentSummary.objects.all()
serializer_class = PaymentSummarySerializer
@action()
def send(self, request, pk=None):
# code to send individual payment summary
class PaymentSummaryViewSet(viewsets.ModelViewSet):
queryset = PaymentSummary.objects.all()
serializer_class = PaymentSummarySerializer
@action()
def send(self, request, pk=None):
# code to send individual payment summary
@collection_action()
def send_pending(self, request):

Current code:

class PaymentSummaryViewSet(viewsets.ModelViewSet):
    queryset = PaymentSummary.objects.all()
    serializer_class = PaymentSummarySerializer
 
    @action()
    def send(self, request, pk=None):
 # code to send individual payment summary
toDigitsRev :: Integer -> [Integer]
toDigitsRev x
| x <= 0 = []
| otherwise = (x `mod` 10) : (toDigitsRev (x `div` 10))
toDigits :: Integer -> [Integer]
toDigits x = reverse (toDigitsRev x)
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther [] = []
Traceback (most recent call last):
File "manage.py", line 18, in <module>
execute_from_command_line(sys.argv)
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/jacob/.virtualenvs/gizmag/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
class Base(object):
def test(self, text):
return 'base, ' + text
class One(object):
def test(self, text):
return 'one, ' + super(One, self).test(text)
class Two(object):
def test(self, text):
var TrackDownloadPanel = React.createClass({
propTypes: {
track: React.PropTypes.object
},
render: function () {
var audioUrls = _.get(this.props.track, "audio_urls", {})
return (
<div className="track-download__container">
<Button className="track-download__button" href={audioUrls.stream}>Download (Stream)</Button>
<Button className="track-download__button" href={audioUrls.archive}>Download (Archive)</Button>
@jacobh
jacobh / CPython Time
Created July 27, 2011 13:16
PyPy & CPython speeds
jacob@debian:~/Projects/Euler$ time python 005.py
smallest number: 232792560
real 5m24.439s
user 5m24.200s
sys 0m0.220s
@jacobh
jacobh / gist:1223927
Created September 17, 2011 13:20
Gunicorn launch error
root@vps:/var/www/weldr.me/Pyzer# python pyzer.py
Bottle server starting up (using GunicornServer())...
Listening on http://0.0.0.0:9998/
Use Ctrl-C to quit.
2011-09-17 17:20:02 [9695] [INFO] Starting gunicorn 0.13.1
2011-09-17 17:20:02 [9695] [INFO] Listening at: http://127.0.0.1:8000 (9695)
2011-09-17 17:20:02 [9695] [INFO] Using worker: sync
2011-09-17 17:20:02 [9702] [INFO] Booting worker with pid: 9702
2011-09-17 17:20:02 [9702] [ERROR] Exception in worker process:
@jacobh
jacobh / 1 processing server
Created September 19, 2011 15:01
Rackspace Load Balancing
Server Software: nginx/0.7.67
Server Hostname: rackspace.weldr.me
Server Port: 80
Document Path: /profile/jacobh/
Document Length: 12472 bytes
Concurrency Level: 128
Time taken for tests: 67.230 seconds
Complete requests: 2000