scrape.nasdaq: Strip whitespace from scraped values
[insider.git] / insider / admin.py
1 from django import forms
2 from django.contrib import admin
3
4 from .models import Person, Exchange, Company, Ticker, Transaction
5
6
7 admin.site.register(Person)
8 admin.site.register(Exchange)
9 admin.site.register(Company)
10 admin.site.register(Ticker)
11 admin.site.register(Transaction)
12
13 #class ActionLinkForm (forms.ModelForm):
14 #    """Only list same-recipe actions for action -> later_action linking.
15 #
16 #    In the Recipe admin model.
17 #    Implementation based on:
18 #
19 #    http://stackoverflow.com/questions/1226760/filter-manytomany-box-in-django-admin
20 #    """
21 #    def __init__(self, *args, **kwargs):
22 #        super(ActionLinkForm, self).__init__(*args, **kwargs)
23 #        actions = Action.objects.filter(recipe=self.instance.recipe_id)
24 #        w = self.fields['later_actions'].widget
25 #        choices = []
26 #        for choice in actions:
27 #            choices.append((choice.id, choice.label))
28 #        w.choices = choices
29 #
30 #
31 #class ActionInline (admin.TabularInline):
32 #    model = Action
33 #    extra = 0
34 #    form = ActionLinkForm
35 #
36 #
37 #class RecipeAdmin (admin.ModelAdmin):
38 #    fieldsets = [
39 #        (None,               {'fields': ['title']}),
40 #        ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}),
41 #        ]
42 #    inlines = [ActionInline]
43 #
44 #    list_display = ['title']
45 #
46 #
47 #admin.site.register(Recipe, RecipeAdmin)
48 #