Skip to content

Commit

Permalink
Updated model field names as per discussion. refs #14, #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Vij committed Oct 13, 2015
1 parent 02f8664 commit 87d4b2b
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 26 deletions.
38 changes: 19 additions & 19 deletions sfm/ui/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,31 @@ class Collection(a.ModelAdmin):


class SeedSet(a.ModelAdmin):
fields = ('collection', 'credential', 'platform', 'name', 'description',
'is_active', 'schedule', 'crawl_options', 'max_count', 'stats',
'date_added', 'date_started', 'date_ended')
list_display = ['collection', 'credential', 'platform', 'name',
'description', 'is_active', 'schedule', 'crawl_options',
'max_count', 'stats', 'date_added', 'date_started',
'date_ended']
list_filter = ['collection', 'credential', 'platform', 'name',
'description', 'is_active', 'schedule', 'crawl_options',
'max_count', 'stats', 'date_added', 'date_started',
'date_ended']
search_fields = ['collection', 'credential', 'platform', 'name',
'description', 'is_active', 'schedule', 'crawl_options',
'max_count', 'stats', 'date_added', 'date_started',
'date_ended']
fields = ('collection', 'credential', 'harvest_type', 'name', 'description',
'is_active', 'schedule', 'harvest_options', 'max_count', 'stats',
'date_added', 'start_date', 'end_date')
list_display = ['collection', 'credential', 'harvest_type', 'name',
'description', 'is_active', 'schedule', 'harvest_options',
'max_count', 'stats', 'date_added', 'start_date',
'end_date']
list_filter = ['collection', 'credential', 'harvest_type', 'name',
'description', 'is_active', 'schedule', 'harvest_options',
'max_count', 'stats', 'date_added', 'start_date',
'end_date']
search_fields = ['collection', 'credential', 'harvest_type', 'name',
'description', 'is_active', 'schedule', 'harvest_options',
'max_count', 'stats', 'date_added', 'start_date',
'end_date']


class Seed(a.ModelAdmin):
fields = ('seed_set', 'platform_token', 'platform_uid', 'is_active',
fields = ('seed_set', 'token', 'uid', 'is_active',
'is_valid', 'stats', 'date_added')
list_display = ['seed_set', 'platform_token', 'platform_uid', 'is_active',
list_display = ['seed_set', 'token', 'uid', 'is_active',
'is_valid', 'stats', 'date_added', 'date_updated']
list_filter = ['seed_set', 'platform_token', 'platform_uid', 'is_active',
list_filter = ['seed_set', 'token', 'uid', 'is_active',
'is_valid', 'stats', 'date_added', 'date_updated']
search_fields = ['seed_set', 'platform_token', 'platform_uid', 'is_active',
search_fields = ['seed_set', 'token', 'uid', 'is_active',
'is_valid', 'stats', 'date_added', 'date_updated']

a.site.register(m.Credential, Credential)
Expand Down
44 changes: 44 additions & 0 deletions sfm/ui/migrations/0002_auto_20151013_1522.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('ui', '0001_initial'),
]

operations = [
migrations.RenameField(
model_name='seed',
old_name='platform_token',
new_name='token',
),
migrations.RenameField(
model_name='seed',
old_name='platform_uid',
new_name='uid',
),
migrations.RenameField(
model_name='seedset',
old_name='date_ended',
new_name='end_date',
),
migrations.RenameField(
model_name='seedset',
old_name='crawl_options',
new_name='harvest_options',
),
migrations.RenameField(
model_name='seedset',
old_name='platform',
new_name='harvest_type',
),
migrations.RenameField(
model_name='seedset',
old_name='date_started',
new_name='start_date',
),
]
14 changes: 7 additions & 7 deletions sfm/ui/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ class SeedSet(models.Model):

collection = models.ForeignKey(Collection, related_name='seed_sets')
credential = models.ForeignKey(Credential, related_name='seed_sets')
platform = models.CharField(max_length=255, blank=True)
harvest_type = models.CharField(max_length=255, blank=True)
name = models.CharField(max_length=255)
description = models.TextField(blank=True)
is_active = models.BooleanField(default=True)
schedule = models.CharField(max_length=255, blank=True)
crawl_options = models.TextField(blank=True)
harvest_options = models.TextField(blank=True)
max_count = models.PositiveIntegerField(default=0)
stats = models.TextField(blank=True)
date_added = models.DateTimeField(default=timezone.now)
date_started = models.DateTimeField(default=timezone.now)
date_ended = models.DateTimeField(default=timezone.now)
start_date = models.DateTimeField(default=timezone.now)
end_date = models.DateTimeField(default=timezone.now)

def __str__(self):
return '<SeedSet %s "%s">' % (self.id, self.name)
Expand All @@ -62,16 +62,16 @@ def __str__(self):
class Seed(models.Model):

seed_set = models.ForeignKey(SeedSet, related_name='seeds')
platform_token = models.TextField(blank=True)
platform_uid = models.TextField(blank=True)
token = models.TextField(blank=True)
uid = models.TextField(blank=True)
is_active = models.BooleanField(default=True)
is_valid = models.BooleanField(default=True)
stats = models.TextField(blank=True)
date_added = models.DateTimeField(default=timezone.now)
date_updated = models.DateTimeField(auto_now=True)

def __str__(self):
return '<Seed %s "%s">' % (self.id, self.platform_token)
return '<Seed %s "%s">' % (self.id, self.token)


class Harvest(models.Model):
Expand Down

0 comments on commit 87d4b2b

Please sign in to comment.