Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PantelisElinas committed Jul 22, 2019
2 parents 1db0b20 + d868484 commit 9c103fb
Show file tree
Hide file tree
Showing 53 changed files with 5,473 additions and 439 deletions.
127 changes: 126 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,129 @@
.idea/
.idea/
.DS_Store
*.sqlite3
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
gnosis/cover
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies

# having no cross-platform support, pipenv may install dependencies that don’t work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker

.pyre/
6 changes: 6 additions & 0 deletions gnosis/catalog/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from django.contrib import admin
from catalog.models import ReadingGroup, ReadingGroupEntry
from catalog.models import Collection, CollectionEntry

# Register your models here.
admin.site.register(ReadingGroup)
admin.site.register(ReadingGroupEntry)
admin.site.register(Collection)
admin.site.register(CollectionEntry)
119 changes: 118 additions & 1 deletion gnosis/catalog/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django import forms
from django.forms import ModelForm, Form
from .models import Paper, Person, Dataset, Venue, Comment, Code
from .models import ReadingGroup, ReadingGroupEntry
from .models import Collection, CollectionEntry
from django.utils.safestring import mark_safe


#
Expand Down Expand Up @@ -63,6 +66,24 @@ def clean_paper_title(self):
required=True, widget=forms.TextInput(attrs={"size": 60})
)

class PaperConnectionForm(Form):
def __init__(self, *args, **kwargs):
super(Form, self).__init__(*args, **kwargs)
for visible in self.visible_fields():
visible.field.widget.attrs["class"] = "form-control"

def clean_paper_title(self):
return self.cleaned_data["paper_title"]

def clean_paper_connection(self):
return self.cleaned_data["paper_connection"]

paper_title = forms.CharField(
required=True, widget=forms.TextInput(attrs={"size": 60})
)
CHOICES = (('cites', 'cites'), ('uses', 'uses'), ('extends', 'extends'),)
paper_connection = forms.ChoiceField(choices=CHOICES)


class SearchPeopleForm(Form):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -141,7 +162,9 @@ def clean_url(self):
return self.cleaned_data["url"]

url = forms.CharField(
label="Source URL, e.g., https://arxiv.org/abs/1607.00653*",
# the label will now appear in two lines break at the br label
# label= mark_safe("Source URL, e.g., https://arxiv.org/abs/1607.00653* <br /> Currently supported websites: arXiv.org, papers.nips.cc, www.jmlr.org/papers <br /> for papers from JMLR, please provide link of the abstract([abs]) page "),
label= mark_safe("Source URL*"),
max_length=200,
widget=forms.TextInput(attrs={"size": 60}),
)
Expand Down Expand Up @@ -344,3 +367,97 @@ def clean_website(self):
class Meta:
model = Code
fields = ["website", "keywords", "description"]


#
# SQL models
#
class GroupForm(ModelForm):
def __init__(self, *args, **kwargs):
super(ModelForm, self).__init__(*args, **kwargs)
# The default for the description field widget is text input. Buy we want to display
# more than one rows so we replace it with a Textarea widget.
self.fields["name"].widget = forms.Textarea()
self.fields["name"].widget.attrs.update({"rows": "1"})

self.fields["description"].widget = forms.Textarea()
self.fields["description"].widget.attrs.update({"rows": "5"})

self.fields["keywords"].label = "Keywords*"
self.fields["description"].label = "Description*"
self.fields["name"].label = "Name*"

for visible in self.visible_fields():
visible.field.widget.attrs["class"] = "form-control"
visible.field.widget.attrs.update({"style": "width:25em"})

def clean_keywords(self):
return self.cleaned_data["keywords"]

def clean_description(self):
return self.cleaned_data["description"]

def clean_name(self):
return self.cleaned_data["name"]

class Meta:
model = ReadingGroup
fields = ["name", "description", "keywords"]


class GroupEntryForm(ModelForm):

def __init__(self, *args, **kwargs):
super(ModelForm, self).__init__(*args, **kwargs)
# The default for the description field widget is text input. Buy we want to display
# more than one rows so we replace it with a Textarea widget.
self.fields["date_discussed"].widget = forms.DateInput()
self.fields["date_discussed"].label = "Date (mm/dd/yyyy)"

for visible in self.visible_fields():
visible.field.widget.attrs["class"] = "form-control"
visible.field.widget.attrs.update({"style": "width:25em"})

def clean_date_discussed(self):
return self.cleaned_data["date_discussed"]

class Meta:
model = ReadingGroupEntry
fields = ["date_discussed"]


#
# Collections
#
class CollectionForm(ModelForm):
def __init__(self, *args, **kwargs):
super(ModelForm, self).__init__(*args, **kwargs)

# The default for the description field widget is text input. Buy we want to display
# more than one rows so we replace it with a Textarea widget.
self.fields["name"].widget = forms.Textarea()
self.fields["name"].widget.attrs.update({"rows": "1"})

self.fields["description"].widget = forms.Textarea()
self.fields["description"].widget.attrs.update({"rows": "5"})

self.fields["keywords"].label = "Keywords"
self.fields["description"].label = "Description"
self.fields["name"].label = "Name*"

for visible in self.visible_fields():
visible.field.widget.attrs["class"] = "form-control"
visible.field.widget.attrs.update({"style": "width:25em"})

def clean_keywords(self):
return self.cleaned_data["keywords"]

def clean_description(self):
return self.cleaned_data["description"]

def clean_name(self):
return self.cleaned_data["name"]

class Meta:
model = Collection
fields = ["name", "description", "keywords"]
Loading

0 comments on commit 9c103fb

Please sign in to comment.