forked from 78/ssbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified: search/admin.py new file: search/management/commands/loadstatus.py new file: search/migrations/0001_initial.py new file: search/migrations/0002_filelist_hash_statusreport.py new file: search/migrations/__init__.py modified: search/models.py modified: search/views.py modified: sphinx.conf modified: ssbc/urls.py modified: web/views.py
- Loading branch information
Showing
10 changed files
with
116 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from django.contrib import admin | ||
from search.models import Hash, FileList | ||
from search.models import Hash, FileList, StatusReport | ||
|
||
# Register your models here. | ||
admin.site.register(Hash) | ||
admin.site.register(FileList) | ||
admin.site.register(StatusReport) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#coding: utf8 | ||
from django.core.management.base import BaseCommand | ||
from django import db as ddb | ||
from search.models import StatusReport | ||
import pymongo | ||
|
||
db = pymongo.MongoClient().dht | ||
|
||
class Command(BaseCommand): | ||
def handle(self, *args, **options): | ||
StatusReport.objects.all().delete() | ||
print 'inputing ...' | ||
for x in db.report_total_d.find().sort('date', 1): | ||
r = StatusReport() | ||
r.date = x['date'] | ||
r.new_hashes = x['new_hashes'] | ||
r.total_requests = x['total_requests'] | ||
r.valid_requests = x['valid_requests'] | ||
r.save() | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('search', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='FileList', | ||
fields=[ | ||
('info_hash', models.CharField(max_length=40, serialize=False, primary_key=True)), | ||
('file_list', models.TextField()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Hash', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('info_hash', models.CharField(unique=True, max_length=40)), | ||
('category', models.CharField(max_length=20)), | ||
('data_hash', models.CharField(max_length=32)), | ||
('name', models.CharField(max_length=255)), | ||
('extension', models.CharField(max_length=20)), | ||
('classified', models.BooleanField(default=False)), | ||
('source_ip', models.CharField(max_length=20, null=True)), | ||
('tagged', models.BooleanField(default=False)), | ||
('length', models.BigIntegerField()), | ||
('create_time', models.DateTimeField()), | ||
('last_seen', models.DateTimeField()), | ||
('requests', models.PositiveIntegerField()), | ||
('comment', models.CharField(max_length=255, null=True)), | ||
('creator', models.CharField(max_length=20, null=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='StatusReport', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('date', models.DateField(auto_now_add=True)), | ||
('new_hashes', models.IntegerField()), | ||
('total_requests', models.IntegerField()), | ||
('valid_requests', models.IntegerField()), | ||
], | ||
), | ||
] |
Empty file.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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