This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
| ########## DO NOT INCLUDE THIS ########## | |
| # File Location: /etc/supervisor/conf.d/celery-beat-appcom.conf | |
| ######################################### | |
| [program:celery_beat_appcom] | |
| process_name=%(program_name)s | |
| command=/home/johndoe/django-app/celery-beat/run-appcom-celery-beat.sh | |
| startsecs=10 | |
| autostart=true | |
| autorestart=true |
| def prepare_order_request_data(self, order: order_models.Order) -> Any: | |
| agent_application = order.agent_application_id | |
| items = list(order.item_set.all()) | |
| express_type = '1' # Standard Express | |
| order_declared_value = 0 | |
| for item in items: | |
| us_converted_item_price_value = round(backend_utils.currency_conversion( | |
| item.item_price_currency, |
| def calculate_dw_at_dl(dw, dl): | |
| lbs = (dw/20.0) * abs(dl-28) | |
| if dl < 28: | |
| return dw - lbs | |
| return lbs + dw |
| def calculate_dw_at_dl(dw, dl): | |
| lbs = (dw/20.0) * abs(dl-28) | |
| if dl < 28: | |
| return dw - lbs | |
| return lbs + dw |
| req.file('image').upload({ | |
| dirname: '../../assets/images/' | |
| }, function(error, uploadedFiles) { | |
| // do something after file was uploaded... | |
| }); | |
| --------------------------------------------------------------- | |
| // save original file name | |
| req.file('image').upload({ | |
| saveAs: function(file, cb) { |
| class DynamicFieldsSerializer(object): | |
| """ | |
| serializer = UserSerializer(fields=['your', 'fields', 'here']) | |
| -- or -- | |
| serializer = UserSerializer(remove_fields=['field', 'to', 'remove']) | |
| """ | |
| def __init__(self, *args, **kwargs): |
| var scrap = require('scrap'); | |
| scrap('https://www.packtpub.com/packt/offers/free-learning', function(err, $){ | |
| console.log($('.dotd-title h2').text().trim()); | |
| }); |
| // in html | |
| <i id="dayatIcon" class="ion-female" to='ion-male'></i> | |
| // create new js file, and include to your html | |
| isAnimating = false; | |
| function dayatIcon(anim){ | |
| $(document).on('mouseenter', '#dayatIcon', function(){ | |
| var e = $(this); | |
| if (isAnimating) return; |
| //index.js | |
| var express = require('express'), | |
| app = module.exports = express.createServer(), | |
| mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost/nodeAuth'); | |
| //configure app | |
| app.configure(function() { | |
| app.set('views', __dirname + '/views'); |