-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create django.yml #29
Open
sindrelothe
wants to merge
44
commits into
main
Choose a base branch
from
sindrelothe-patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
dfae2ed
Create django.yml
sindrelothe 220f410
Change files to correct project in pylint command
sindrelothe 1fa6248
change branch name to "main"
sindrelothe ee538f9
Merge branch 'main' into sindrelothe-patch-1
sindrelothe 2b339e4
fix linting errors for some files
sindrelothe 1835c9b
fix linting errors for choices.py, /fields/__init__, weekday.py
sindrelothe a4dabe5
Change pylint disable codes to names
sindrelothe ef09acb
Fix more pylint errors
sindrelothe 6984709
Remove eval function from heroku.py
sindrelothe d68104b
fix final pylint errors
sindrelothe 6b928a8
fix final pylint error
sindrelothe 32ac51d
merge with main
sindrelothe 79f7de5
remove help_text for Tag class
sindrelothe b468c80
add trailing comma for lists in tag.py
sindrelothe b0bcc49
added trailing comma to urls.py
sindrelothe b6f33be
Add specific exception to apps.py
sindrelothe bb0ddfb
disable fixme from pylint
sindrelothe 443fd8d
fix migrate bug
sindrelothe 0811664
fix error with github tests
sindrelothe 13a4756
fix error with github tests
sindrelothe bd767eb
copy fix from rekenett for github tests
sindrelothe 351a541
run migrate before pylint in django.yml'
sindrelothe 576cad0
add settings config to apps.py
sindrelothe 5dfa0d6
remove introduced error in apps.py
sindrelothe f64388d
add DJANGO_SETTINGS_MODULE to yml script
sindrelothe 78b200c
Update django.yml
sindrelothe e0581c1
Update django.yml
sindrelothe 2cf9ff5
add new line
sindrelothe ba0bcd2
fix pipeline
sindrelothe 7df6683
fix pipeline
sindrelothe 9111c6d
move verify migrations to before run pylint in yml
sindrelothe 4946d49
add makemigrations to yml
sindrelothe 227240a
merge main
sindrelothe 31c5fe4
fix merge conflicts
sindrelothe e859ea0
fix merge conflicts
sindrelothe ba5254f
update python version in django.yml
sindrelothe 4d1d07e
remove arguments from 'makemigrations' in djano.yml
sindrelothe a1fba86
remove migrations file
sindrelothe a0588f9
remove pylint from django.yml
sindrelothe 095ba29
remove run pytest from infoscreen
sindrelothe b018e31
add linting to django.yml
sindrelothe ab1d4b3
remove linting of root
sindrelothe 556722f
remove linting of root
sindrelothe 0c2bd5f
use .sh structure to lint
sindrelothe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Django CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
# Prevent multiple workflows with same branch/pull_request | ||
concurrency: | ||
group: ${{ github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PIPENV_VENV_IN_PROJECT: 1 | ||
ENV: development | ||
SECRET_KEY: NOT SET | ||
DJANGO_SUPERUSER_USERNAME: admin | ||
DJANGO_SUPERUSER_PASSWORD: Django123 | ||
DJANGO_SUPERUSER_EMAIL: [email protected] | ||
DJANGO_SETTINGS_MODULE: root.settings | ||
|
||
jobs: | ||
job_build_django: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9.2' # Closest version to 3.7.3 available. | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -V | ||
PY=$(which python) | ||
echo $PY | ||
python -m pip install --upgrade pip | ||
python -m pip install pipenv | ||
python -m pipenv install --python $PY | ||
|
||
- name: Verify migrations | ||
run: | | ||
python -m pipenv run python manage.py makemigrations | ||
python -m pipenv run python manage.py migrate | ||
|
||
- name: Run pylint | ||
run: python -m pipenv run pylint ./run-pylint.sh | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from django.apps import AppConfig | ||
from django.core import management | ||
|
||
|
||
class InfoScreenConfig(AppConfig): | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .restricted_file import ContentTypeRestrictedFileField | ||
# from .weekday import WeekdayField | ||
# from .weekday import WeekdayField |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# from django.db.models import IntegerField | ||
# | ||
# | ||
# class WeekDayField(IntegerField): | ||
# | ||
# | ||
# def __init__(self, *args, **kwargs): | ||
# kwargs['choices'] = self.DAYS | ||
# super().__init__(*args, **kwargs) | ||
# | ||
# def clean(self, *args, **kwargs): | ||
# | ||
# def clean(self, *args, **kwargs): | ||
# data = super().clean(*args, **kwargs) | ||
# try: | ||
# if data and 0 > data > 6: raise forms.ValidationError(_('Ikke eksisterende ')) | ||
# except AttributeError: | ||
# pass | ||
# pass | ||
# return data |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,64 @@ | ||
# imports | ||
import re | ||
|
||
from django.db import models | ||
from django.db.models import Q | ||
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError | ||
|
||
from root import models as root_models | ||
|
||
# End: imports ----------------------------------------------------------------- | ||
|
||
|
||
class Tag(root_models.CustomBaseModel): | ||
name = models.CharField(max_length=200, unique=True, null=False, blank=False, verbose_name='navn', help_text="En vilkårlig egenskap til en plante. (Tips: Du kan prefikse tags med kolon ':', f.eks. 'familie:fiola' )") | ||
bg = models.ForeignKey('infoscreen.Color', on_delete=models.SET_NULL, null=True, blank=True, related_name='tag_bg', verbose_name='bakgrunnsfarge') | ||
font = models.ForeignKey('infoscreen.Color', on_delete=models.SET_NULL, null=True, blank=True, related_name='tag_font', verbose_name='skriftfarge') | ||
group = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True, related_name='children', verbose_name='gruppe') | ||
|
||
name = models.CharField( | ||
max_length=200, | ||
unique=True, | ||
null=False, | ||
blank=False, | ||
verbose_name='navn', | ||
) | ||
bg = models.ForeignKey( | ||
'infoscreen.Color', | ||
on_delete=models.SET_NULL, | ||
null=True, | ||
blank=True, | ||
related_name='tag_bg', | ||
verbose_name='bakgrunnsfarge', | ||
) | ||
font = models.ForeignKey( | ||
'infoscreen.Color', | ||
on_delete=models.SET_NULL, | ||
null=True, | ||
blank=True, | ||
related_name='tag_font', | ||
verbose_name='skriftfarge', | ||
) | ||
group = models.ForeignKey( | ||
'self', | ||
on_delete=models.SET_NULL, | ||
null=True, | ||
blank=True, | ||
related_name='children', | ||
verbose_name='gruppe', | ||
) | ||
|
||
class Meta: | ||
ordering = [] | ||
verbose_name = 'tag' | ||
verbose_name_plural = 'tags' | ||
|
||
def __str__(self): | ||
return f"{self.full_name()}" | ||
return f'{self.full_name()}' | ||
|
||
def full_name(self): | ||
if self.group: | ||
return f"{self.group.full_name()} :: {self.name}" | ||
return f"{self.name}" | ||
|
||
|
||
return f'{self.group.full_name()} :: {self.name}' | ||
return f'{self.name}' | ||
|
||
def color_list(self): | ||
"""Hierarchical list of colors from least to most significant""" | ||
colors = [] | ||
if self.tag_group: | ||
colors += self.tag_group.color_list() | ||
if self.color: | ||
colors.append(self.color) | ||
if self.group: | ||
colors += self.group.color_list() | ||
if self.bg: | ||
colors.append(self.bg) | ||
return colors | ||
|
||
def color_list_css(self): | ||
return [color.as_css() for color in self.color_list()] | ||
|
||
|
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,15 +1,15 @@ | ||
from django.db import models | ||
from root import models as root_models | ||
from ..utils.__init__ import parse_url | ||
|
||
from root import models as root_models | ||
|
||
class Video(root_models.CustomBaseModel): | ||
name = models.CharField(max_length=140, null=True, blank=True) | ||
youtube_code = models.CharField(max_length=140, null=False, blank=False) | ||
|
||
def __str__(self): | ||
return f"{self.name}" | ||
return f'{self.name}' | ||
|
||
def save(self, *args, **kwargs): | ||
self.youtube_code = parse_url(self.youtube_code) | ||
super().save(*args, **kwargs) |
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 |
---|---|---|
|
@@ -41,3 +41,4 @@ | |
</div> | ||
{% endblock %} | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm er dette riktig?