Skip to content

Commit

Permalink
update project with sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsarik committed Dec 4, 2016
2 parents d5ae024 + 824ce79 commit ac33da8
Show file tree
Hide file tree
Showing 145 changed files with 5,233 additions and 5,417 deletions.
16 changes: 16 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
configparser
django==1.8
six
gsi
django-debug-toolbar
django-annoying
django-solo
django-grappelli
djangorestframework
markdown
django-filter
django-registration-redux==1.3
python-magic==0.4.11
django-extensions
django-crispy-forms==1.4.0
django-ckeditor==5.1.1
330 changes: 38 additions & 292 deletions src/api/views.py

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/articles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@login_required
@render_to('articles/wiki_show.html')
def wiki_show(request):
''' View Wiki Show '''
title = 'Wiki'
articles = Article.objects.all()

Expand All @@ -32,6 +33,7 @@ def wiki_show(request):


class ArticleUpdateForm(ModelForm):
''' View ArticleUpdateForm '''
class Meta:
model = Article
fields = ('title', 'content',)
Expand Down Expand Up @@ -65,10 +67,15 @@ def __init__(self, *args, **kwargs):


class WikiUpdateView(UpdateView):
''' View WikiUpdateView '''

model = Article
template_name = 'articles/wiki_edit.html'
form_class = ArticleUpdateForm

def __init__(self, *args, **kwargs):
super(WikiUpdateView, self).__init__(*args, **kwargs)

def get_form_kwargs(self):
kwargs = super(WikiUpdateView, self).get_form_kwargs()
# print 'kwargs ========================== ', kwargs['instance'].id
Expand Down Expand Up @@ -101,6 +108,7 @@ def dispatch(self, *args, **kwargs):
@login_required
@render_to('articles/wiki_edit.html')
def wiki_edit(request, wiki_id):
''' View wiki_edit '''
title = 'Wiki Edit'
url_name = 'wiki_edit'
form = None
Expand Down
4 changes: 0 additions & 4 deletions src/cards/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ class CardItemAdmin(admin.ModelAdmin):
}),
)

# autocomplete_lookup_fields = {
# 'contenttypes.models': [['content_type', 'object_id']],
# }

list_display = ('name', 'content_type')

def name(self, instance):
Expand Down
86 changes: 82 additions & 4 deletions src/cards/card_update_create.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# -*- coding: utf-8 -*-
from cards.models import (QRF, RFScore, Remap,
YearFilter, Collate, PreProc,
MergeCSV, RFTrain, RandomForest,
CalcStats)
from cards.models import (QRF, RFScore, Remap, YearFilter, Collate, PreProc,
MergeCSV, RFTrain, RandomForest, CalcStats)
from gsi.models import ListTestFiles


def qrf_update_create(form, item_id=None):
"""**Updated card QRF.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
qrf_card = None

Expand Down Expand Up @@ -37,6 +43,14 @@ def qrf_update_create(form, item_id=None):


def rfscore_update_create(form, item_id=None):
"""**Updated card RFScore.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
rfscore_card = None

Expand Down Expand Up @@ -75,6 +89,14 @@ def rfscore_update_create(form, item_id=None):


def remap_update_create(form, item_id=None):
"""**Updated card Remap.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
remap_card = None

Expand Down Expand Up @@ -133,6 +155,14 @@ def remap_update_create(form, item_id=None):


def year_filter_update_create(form, item_id=None):
"""**Updated card YearFilter.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
year_filter_card = None

Expand Down Expand Up @@ -173,6 +203,14 @@ def year_filter_update_create(form, item_id=None):


def collate_update_create(form, item_id=None, multiple=None, delete=False):
"""**Updated card Collate.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
collate_card = None

Expand Down Expand Up @@ -227,6 +265,14 @@ def collate_update_create(form, item_id=None, multiple=None, delete=False):


def preproc_update_create(form, item_id=None):
"""**Updated card PreProc.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
preproc_card = None

Expand Down Expand Up @@ -259,6 +305,14 @@ def preproc_update_create(form, item_id=None):


def mergecsv_update_create(form, item_id=None):
"""**Updated card MergeCSV.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
mergecsv_card = None

Expand All @@ -285,6 +339,14 @@ def mergecsv_update_create(form, item_id=None):


def rftrain_update_create(form, item_id=None):
"""**Updated card RFTrain.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
rftrain_card = None

Expand Down Expand Up @@ -327,6 +389,14 @@ def rftrain_update_create(form, item_id=None):


def randomforest_update_create(form, item_id=None):
"""**Updated card RandomForest.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
randomforest_card = None

Expand Down Expand Up @@ -361,6 +431,14 @@ def randomforest_update_create(form, item_id=None):


def calcstats_update_create(form, item_id=None):
"""**Updated card CalcStats.**
:Arguments:
* *form*: Object of the form
* *item_id*: ID of the card. Set when editing (the default=None when you create a card)
"""

cur_card = None
calcstats_card = None
filter_out = form.cleaned_data["filter_out"]
Expand Down
36 changes: 16 additions & 20 deletions src/cards/cards_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@
from django import forms

from core.validator_gsi import validate_order
from cards.models import (QRF, RFScore, Remap,
YearFilter, Collate, PreProc,
MergeCSV, RFTrain, RandomForest, CalcStats,
FILTER_OUT, PERIOD)
from gsi.models import (Area, YearGroup, TileType,
Satellite, InputDataDirectory, ListTestFiles,)


# , 'readonly': 'readonly'
from cards.models import (QRF, RFScore, Remap, YearFilter, Collate, PreProc,
MergeCSV, RFTrain, RandomForest, CalcStats, FILTER_OUT, PERIOD)
from gsi.models import (Area, YearGroup, TileType, Satellite, InputDataDirectory, ListTestFiles,)


class QRFForm(forms.ModelForm):

""" form for editing QRF Card """
"""**Form for editing QRF Card.**"""

def __init__(self, *args, **kwargs):
super(QRFForm, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -64,7 +57,8 @@ class Meta:


class RFScoreForm(forms.ModelForm):
""" form for editing RFScore Card """
"""**form for editing RFScore Card.**"""

def __init__(self, *args, **kwargs):
super(RFScoreForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -138,7 +132,8 @@ class Meta:


class RemapForm(forms.ModelForm):
""" form for editing Remap Card """
"""**Form for editing Remap Card.**"""

def __init__(self, *args, **kwargs):
super(RemapForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -273,7 +268,8 @@ class Meta:


class YearFilterForm(forms.ModelForm):
""" form for editing YearFilter Card """
"""**Form for editing YearFilter Card.**"""

def __init__(self, *args, **kwargs):
super(YearFilterForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -352,7 +348,7 @@ class Meta:


class CollateForm(forms.ModelForm):
""" form for editing Collate Card """
"""**Form for editing Collate Card.**"""
def __init__(self, *args, **kwargs):
super(CollateForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -423,7 +419,7 @@ class Meta:


class PreProcForm(forms.ModelForm):
""" form for editing PreProc Card """
"""**Form for editing PreProc Card.**"""
def __init__(self, *args, **kwargs):
super(PreProcForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -477,7 +473,7 @@ class Meta:


class MergeCSVForm(forms.ModelForm):
""" form for editing MergeCSV Card """
"""**Form for editing MergeCSV Card.**"""
def __init__(self, *args, **kwargs):
super(MergeCSVForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -509,7 +505,7 @@ class Meta:


class RFTrainForm(forms.ModelForm):
""" form for editing RFTrain Card """
"""**Form for editing RFTrain Card.**"""
def __init__(self, *args, **kwargs):
super(RFTrainForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -600,7 +596,7 @@ class Meta:


class RandomForestForm(forms.ModelForm):
""" form for editing RandomForest Card """
"""**Form for editing RandomForest Card.**"""
def __init__(self, *args, **kwargs):
super(RandomForestForm, self).__init__(*args, **kwargs)

Expand Down Expand Up @@ -654,7 +650,7 @@ class Meta:


class CalcStatsForm(forms.ModelForm):
""" form for editing CalcStats Card """
"""**Form for editing CalcStats Card.**"""

def __init__(self, *args, **kwargs):
super(CalcStatsForm, self).__init__(*args, **kwargs)
Expand Down

0 comments on commit ac33da8

Please sign in to comment.