coding utf-8 from django db import models from django contrib import a

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin
from services.lib.models_extends import IPorURLField
#Модель для таблицы со списками прокси
class Proxylists(models.Model):
ip=IPorURLField()
port=models.IntegerField()
type=models.CharField(max_length=128)
status=models.FloatField()
last_check=models.DateTimeField(auto_now=True)
def __unicode__(self):
return str(self.ip)+":"+str(self.port)
class Meta():
ordering=['status', 'last_check']
class ProxylistsAdmin(admin.ModelAdmin):
list_display=('ip', 'port', 'type', 'status')
admin.site.register(Proxylists, Proxylists.ProxylistsAdmin)