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
def queryset(self, request): | |
qs = super(NetworksAdmin, self).queryset(request) | |
try: | |
ip = request.GET['q'] | |
tmp = ipaddr.IPAddress(ip).packed | |
qs = qs.filter(netmin__lte=ip, netmax__gte=ip) | |
#print len(qs) | |
for q in qs: | |
print q |
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
self.x_severity = None # Log event severity (DEBUG, INFO, WARN, ERROR, FATAL) | |
self.x_category = None # Log event category (server, vhost, application, session, stream) | |
self.x_event = None # Log event (see table below) | |
self.tz_ = None # Time zone of log event | |
self.date_ = None # Ex.: '2013-01-29' | |
self.time_ = None # Ex.: '10:00:05' | |
self.c_client_id = None # Client ID number assigned by the server to the connection | |
self.c_ip = None # Client connection IP address | |
self.c_port = None # Client connection port | |
self.cs_bytes = None # Total number of bytes transferred from client to server (accumulative) |
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
# Django settings for azionmanager project. | |
# -*- encoding: utf-8 -*- | |
import os | |
import sys | |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
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
# Django settings for azionmanager project. | |
# -*- encoding: utf-8 -*- | |
import os | |
import sys | |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
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
# Django settings for azionmanager project. | |
# -*- encoding: utf-8 -*- | |
import os | |
import sys | |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
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
# Django settings for azionmanager project. | |
# -*- encoding: utf-8 -*- | |
import sys | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
'NAME': 'azionmanager', # Or path to database file if using sqlite3. | |
'USER': 'root', # Not used with sqlite3. |
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
def save(self, domain_override=None, | |
subject_template_name='registration/password_reset_subject.txt', | |
email_template_name='registration/password_reset_email.html', | |
use_https=False, token_generator=default_token_generator, | |
from_email=None, request=None): | |
""" | |
Generates a one-use only link for resetting password and sends to the | |
user. | |
""" | |
from django.core.mail import send_mail |
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 Account(models.Model): | |
pass | |
class Brand(Account): | |
name = models.CharField() | |
class Company(Brand): | |
parent = models.ForeignKey(Brand) | |
class Reseller(Company): |
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 Account(PolymorphicMPTTModel): | |
parent = PolymorphicTreeForeignKey('self', | |
null=True, | |
blank=True, | |
related_name='children', | |
verbose_name=_('parent')) | |
name = models.CharField(max_length=150, unique=True) | |
company_name = models.CharField(max_length=150, unique=True, | |
help_text=_('Corportate Name')) |
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 History(models.Model): | |
changed_by = models.ForeignKey('user.CustomUser', null=True, blank=True) | |
history = HistoricalRecords() | |
@property | |
def _history_user(self): | |
return self.changed_by | |
@_history_user.setter |