bash-3.2$ docker exec -it [container ID] mongo
MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.10
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
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.http import HttpResponse | |
| from django.template import RequestContext, loader | |
| from foo.models import Baz | |
| ... | |
| def foo(request): | |
| queryset = Baz.objects.order_by('date') | |
| template_name = 'my_template.html' | |
| mimetype = 'text/plain' |
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
| #main/contexts.py | |
| from django.core.urlresolvers import resolve, Resolver404 | |
| def appname(request): | |
| try: | |
| app_label = resolve(request.path).app_name | |
| except Resolver404: | |
| app_label = None | |
| return {'appname': app_label} |
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 __future__ import print_function | |
| >>> import mlbgame | |
| >>> game = mlbgame(2016, 4, 26, home='Mariners'][0] | |
| >>> stats = mlbgame.player_stats(game.game_id) | |
| >>> for player in stats['home_batting']: | |
| ... print(player.name_display_first_last, player.avg) | |
| ... | |
| Norichika Aoki 0.205 | |
| Ketel Marte 0.238 | |
| Robinson Cano 0.224 |
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
| ''' | |
| Experiments in extending the django_scheduler Event class via the built-in EventRelation class. | |
| ''' | |
| >>> from schedule.models import Calendar, Event, EventRelation | |
| >>> from civic_calendar.models import Meeting | |
| >>> event = Event.objects.get(pk=2) | |
| >>> meeting = Meeting.objects.get(pk=2) | |
| >>> er = EventRelation(event=event, content_object=meeting) | |
| >>> er.save() |
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
| Traceback (most recent call last): | |
| File "/Users/jpheasly/.virtualenvs/tarbell/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__ | |
| return self.wsgi_app(environ, start_response) | |
| File "/Users/jpheasly/.virtualenvs/tarbell/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app | |
| response = self.make_response(self.handle_exception(e)) | |
| File "/Users/jpheasly/.virtualenvs/tarbell/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception | |
| reraise(exc_type, exc_value, tb) | |
| File "/Users/jpheasly/.virtualenvs/tarbell/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app | |
| response = self.full_dispatch_request() | |
| File "/Users/jpheasly/.virtualenvs/tarbell/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request |
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
| # Related, from News Nerdery thread: | |
| # | |
| # aricchokey 2 hours ago | |
| # @ejmurra Looks like another way to grab the data is by tacking on a ".csv" at the end of the chosen sheet. It will | |
| # return the delimited version of the data/trigger the download from Tableau, too. | |
| # Like https://bi.ahca.myflorida.com/t/ABICC/views/Public/HospitalBedsHospital.csv or | |
| # https://bi.ahca.myflorida.com/t/ABICC/views/Public/ICUBedsCounty.csv. Might get rid of the need for a payload | |
| # in your script. | |
| from bs4 import BeautifulSoup |
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
| mydate | cday | dday | ma | |
|---|---|---|---|---|
| 2020-03-01 | 0.0 | 0.0 | ||
| 2020-03-02 | 0.0 | 0.0 | ||
| 2020-03-03 | 0.0 | 0.0 | ||
| 2020-03-04 | 0.0 | 0.0 | ||
| 2020-03-05 | 0.0 | 0.0 | ||
| 2020-03-06 | 0.0 | 0.0 | ||
| 2020-03-07 | 0.0 | 0.0 | 0.0 | |
| 2020-03-08 | 0.0 | 0.0 | 0.0 | |
| 2020-03-09 | 0.0 | 0.0 | 0.0 |
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
| mydate,cday,dday,ma | |
| 2020-03-01,0.0,0.0, | |
| 2020-03-02,0.0,0.0, | |
| 2020-03-03,0.0,0.0, | |
| 2020-03-04,0.0,0.0, | |
| 2020-03-05,0.0,0.0, | |
| 2020-03-06,0.0,0.0, | |
| 2020-03-07,0.0,0.0,0.0 | |
| 2020-03-08,1.0,0.0,0.14285714285714285 | |
| 2020-03-09,0.0,0.0,0.14285714285714285 |
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
| mydate,cday,dday,ma | |
| 2020-03-01,0.0,0.0, | |
| 2020-03-02,0.0,0.0, | |
| 2020-03-03,0.0,0.0, | |
| 2020-03-04,0.0,0.0, | |
| 2020-03-05,0.0,0.0, | |
| 2020-03-06,0.0,0.0, | |
| 2020-03-07,0.0,0.0,0.0 | |
| 2020-03-08,1.0,0.0,0.14285714285714285 | |
| 2020-03-09,0.0,0.0,0.14285714285714285 |