This file contains 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
# Example usage of database funtions(`Sum` and `Avg`) and Django `JSONField`'s `jsonb_array_length` | |
# PostgreSQL json field functions: https://www.postgresql.org/docs/9.5/static/functions-json.html | |
# Django `F` and `Func`: https://docs.djangoproject.com/en/1.10/ref/models/expressions/#f-expressions | |
# Django aggregation: https://docs.djangoproject.com/en/1.10/topics/db/aggregation/ | |
# Django `JSONField`: https://docs.djangoproject.com/en/1.9/ref/contrib/postgres/fields/#jsonfield | |
# Given a model | |
class Contact(models.Model): | |
numbers = JSONField(help_text="An array of numbers") |
This file contains 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
/********************************************************************************* | |
Author: Nicholas Cole | |
Author URI: http://oceanbluecreative.com.au | |
License: MIT | |
Usage: Sass Partial for native UI tweaks in Cordova/PhoneGap apps | |
Gist: https://gist.github.com/ncole458/49bb6b0309572dc429ea | |
**********************************************************************************/ |
This file contains 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 -*- | |
from __future__ import absolute_import | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
import json | |
import uuid | |
import time | |
import gevent |