Skip to content

Commit

Permalink
🎨 Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
eduzen committed Aug 22, 2023
2 parents 0a5f2e1 + 2c73e4c commit eb73351
Show file tree
Hide file tree
Showing 87 changed files with 929 additions and 3,367 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
uses: docker/setup-buildx-action@v2.9.1

- name: Login to DockerHub
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v4.1.1
with:
push: true
tags: eduzen/website:latest
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.14.0"
rev: "1.14.1"
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]
Expand All @@ -42,7 +42,7 @@ repos:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.284'
rev: 'v0.0.285'
hooks:
- id: ruff
# Respect `exclude` and `extend-exclude` settings.
Expand Down
18 changes: 18 additions & 0 deletions blog/context_processor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import datetime as dt

from django.http import HttpRequest


def global_data(request: HttpRequest) -> dict[str, dict[str, str]]:
start_year = 2011
start_python = 2014
current_year = dt.datetime.now().year
data = {
"linkedin": "https://www.linkedin.com/in/eduzen/",
"github": "https://github.com/eduzen",
"email": "mailto:me@eduzen.com.ar",
"telegram": "https://t.me/eduzen",
"years_in_python": current_year - start_python,
"years_of_experience": current_year - start_year,
}
return {"global_data": data}
17 changes: 17 additions & 0 deletions blog/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import django_filters
from django.contrib.postgres.search import SearchVector
from django.db.models import QuerySet

from blog.models import Post


class PostFilter(django_filters.FilterSet):
q = django_filters.CharFilter(method="filter_search", label="Search")

class Meta:
model = Post
fields = []

def filter_search(self, queryset: QuerySet[Post], name: str, value: str) -> QuerySet[Post]:
search_vector = SearchVector("text", "title", "pompadour")
return queryset.annotate(search=search_vector).filter(search=value)
Loading

0 comments on commit eb73351

Please sign in to comment.