from models.connection import db
import models.pre_save_hooks as hooks
class DocumentWithPreSaveSupport(db.Document):
_pre_save_hooks = []
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
| # coding=utf-8 | |
| """Lazy helpers""" | |
| from importlib import import_module | |
| import re | |
| from django.utils.functional import SimpleLazyObject | |
| class LazyModule(object): | |
| """Lazily reference a module, to prevent circular imports""" |
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
| dependencies: | |
| flutter: | |
| sdk: flutter | |
| flutter_localizations: | |
| sdk: flutter | |
| shared_preferences: ^0.4.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
| Pandas: | |
| - Intro to pandas | |
| - Installing pandas | |
| - Little info about the data set | |
| - Load the data into data frame | |
| - Displaying and querying data | |
| - Clean the data | |
| - Find Number of coffees made on which day of week | |
| - Find Number of coffees by members | |
| - Show monthly trend of coffees |
"annReturn" : pow((r["aggCumulativeReceivedAmt"]-r["aggCumulativeCoAmt"]+r["aggCumulativePbalEndPeriod"])/r["aggCumulativePbalBegPeriod"] , 12)-1,
"annLoss" : ((r["aggCumulativeCoAmt"])/r["aggCumulativePbalBegPeriod"]) * 12,
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
| # | |
| # Usage: | |
| # gdeploy -c 2+1-volume-create.conf | |
| # | |
| # This does backend setup first and then create the volume using the | |
| # setup bricks. | |
| [hosts] | |
| 165.227.80.95 |
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
| web_1 | [2017-08-04 06:47:58,877] ERROR in app: Exception on /upload/ [POST] | |
| web_1 | Traceback (most recent call last): | |
| web_1 | File "/usr/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app | |
| web_1 | response = self.full_dispatch_request() | |
| web_1 | File "/usr/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request | |
| web_1 | rv = self.handle_user_exception(e) | |
| web_1 | File "/usr/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception | |
| web_1 | reraise(exc_type, exc_value, tb) | |
| web_1 | File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise | |
| web_1 | raise value |
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_portfolio_notes_by_month(portfolioId): | |
| """ | |
| Group Portfolio notes by month of purchase | |
| Input: Trade History by month | |
| """ | |
| pipeline = [ | |
| { | |
| '$match': { | |
| 'portfolioId': portfolioId, | |
| 'issueDate': {'$exists': True, '$ne': None} |
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
| Todays step would be to setup the auth for amoux | |
| Before you get your hands dirty I would suggest you to clone and install all the dependencies. | |
| Once done install flask-jwt, to read about jwt http://blog.jaysinh.com/slides-jwt/#1 | |
| Once that's done you will need to create two functions like the below examples: | |
| @staticmethod | |
| def authenticate(email, password): | |
| user = User.objects(email = email).first() | |
| if user: | |
| user.id = str(user.id) |
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 you want to make a PR, put your changes in here. If you want your changes to | |
| " stay local, put them in ~/.vimrc.local. | |
| " don't bother with vi compatibility | |
| set nocompatible | |
| " enable syntax highlighting | |
| syntax enable | |
| " Vundle |
NewerOlder