$ip ="192.168.1.1"
$wq = (‘select statuscode from win32_pingstatus where address="’ + $ip + ‘"’)
$res = gwmi –query "$wq"
if ($res.StatusCode –eq 0) {
write-host "1"
} else {
write-host "0"
}
$res = $null
...
class Meta:
managed = False
db_table = 'orders'
def GetNumOrder(self, idOrder):
from django.db import connection
cursor = connection.cursor()
cursor.execute("SELECT getordernum(%s) as id", [idOrder])
row = cursor.fetchone()
return row[0]