This is a common case in django ORM.
from django.db import models
class Author(models.Model):
/* | |
Author: Michael Stevenson | |
Date : 2014/09/03 | |
Desc : Receive HL7 message from an MLP tcp interface on a specific port and ip. | |
Saves message to folder on PC. Constructs and sends ACK back to interface | |
*/ | |
var net = require('net'); | |
var fs = require('fs'); |
Visual Studio 2019 Product Key | |
[Please Star this gist] | |
**Follow Me On Instagram -->> https://www.instagram.com/ahtazaz_mughal/** | |
Whatsapp +923451525359 | |
Visual Studio 2019 Enterprise |
<?php | |
// Initilise cURL | |
$ch = curl_init(); | |
// Set the cURL Options | |
$optArray = array( | |
CURLOPT_URL => 'https://example.com/api/getInfo/', | |
CURLOPT_RETURNTRANSFER => true | |
); |
<?php | |
/* Fetch XML feeds using PHP SimpleXML and cURL */ | |
/* Step 1) Parse xml url in curl and assign all data into a variable | |
Step 2) Pass Xml data into SimpleXML and access elements using returned object */ | |
/* =================The SimpleXML ========================= | |
The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators. | |
This extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required, although this is implicitly accomplished because libxml is enabled by default. The SimpleXML extension requires PHP 5. |
#!/bin/sh | |
set -e | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "Database name argument is required" |
from django.contrib import admin | |
from django.contrib.admin.models import LogEntry | |
from django.db.models import ManyToOneRel, ForeignKey, OneToOneField | |
from django.apps import apps | |
from django.contrib.auth.models import Group, User | |
from django.contrib.auth.admin import GroupAdmin, UserAdmin | |
from django.conf.urls import url | |
# admin custom views | |
from . import admin_views |
Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
from django.template import Library | |
register = Library() | |
@register.simple_tag | |
def get_field_verbose_name(instance, field_name): | |
"""Returns the verbose_name of the specified field.""" | |
return instance._meta.get_field(field_name).verbose_name.title() |