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
$(document).ready(function(){ | |
$('#search-data').dataTable( { | |
destroy: true, // destroy previous datatable to remove error. | |
"ajax": url, | |
"columns": [ | |
{"data":"latitude"}, | |
{"data":"longitude"}, | |
{"data":"data__product_data__Name"}, | |
{"data":"id__count"}, | |
] |
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
class FundRaisePerMonth(APIView): | |
def get(self, request): | |
year = datetime.date.today().year | |
# Filter data as monthly(number serial) [{'month_serial': views_count} like [{'1': 50, '2': 55}] | |
queryset = CustomUser.objects.filter(date_joined__year=year) | |
search = queryset.annotate(month=ExtractMonth('date_joined'),).order_by('month').values('month')\ | |
.annotate(total=Sum('amount')).values('month', 'total') | |
# convert int month to str month, 1 to January | |
data = [] |
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
$.ajax({ | |
url: apiUrl, | |
method: 'POST', | |
contentType: "application/json", | |
dataType: 'json', | |
data: JSON.stringify(orderData), | |
headers: { | |
'X-CSRFToken': csrftoken, | |
'Accept': 'application/json', | |
'Content-Type': 'application/json' |
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
#!/bin/bash | |
# Initialize credential veriable | |
dbname=teamshape | |
dbuser=admin | |
userpass=admin | |
# install python3.8 | |
echo "Installing python3.8" | |
sudo add-apt-repository ppa:deadsnakes/ppa |
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
with open(str(BASE_DIR) + '/oidc.key', 'rb') as f: | |
OIDC_RSA_PRIVATE_KEY = f.read().decode() |
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
deposit_sum = Sum('amount', filter=Q(transaction_type='deposit')) | |
withdraw_sum = Sum('amount', filter=Q(transaction_type='withdraw')) | |
deposit = Savings.objects.filter(branch=branch).aggregate( | |
total_deposit= deposit_sum - withdraw_sum | |
)['total_deposit'] |
OlderNewer