-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
580 additions
and
106 deletions.
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
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,28 +1,27 @@ | ||
name: Release on PYPI | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
branches: [main] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'bnzk/django-postgres-searchindex' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel twine | ||
- name: Build | ||
run: | | ||
python setup.py sdist | ||
python setup.py bdist_wheel --universal | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER_BNZK }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PW_BNZK }} | ||
run: twine upload dist/* | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel twine | ||
- name: Build | ||
run: | | ||
python setup.py sdist | ||
python setup.py bdist_wheel --universal | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER_BNZK }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PW_BNZK }} | ||
run: twine upload dist/* |
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 |
---|---|---|
|
@@ -60,4 +60,3 @@ coverage.xml | |
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
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,61 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
exclude: "^package.json|^package-lock.json" | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
# syntax | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-xml | ||
- id: pretty-format-json | ||
args: ["--autofix"] | ||
# git & filesystem | ||
- id: check-added-large-files | ||
- id: check-symlinks | ||
- id: detect-private-key | ||
- id: check-merge-conflict | ||
- id: check-case-conflict # file conflicts: a.txt vs. A.txt | ||
# formatters | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
exclude: "(.*\\.html|.*\\.md)$" | ||
- id: end-of-file-fixer | ||
exclude: "(.*\\.xml|.*\\.svg)$" | ||
# python | ||
- id: check-ast # abstract syntax tree | ||
- id: check-builtin-literals # no {} and [], but dict() and list() | ||
- id: debug-statements | ||
# - id: name-tests-test | ||
# args: [--pytest-test-first] | ||
# django-upgrade suggestions | ||
- repo: https://github.com/adamchainz/django-upgrade | ||
rev: "1.14.0" | ||
hooks: | ||
- id: django-upgrade | ||
args: [--target-version, "4.2"] | ||
# tha black | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: "23.7.0" | ||
hooks: | ||
- id: black | ||
# flake8 replacement (&more) | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: "v0.0.284" | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
# js/sass/etc formatter | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.0.2 | ||
hooks: | ||
- id: prettier | ||
args: [--list-different] | ||
exclude: "(.*\\.html|.*\\.md)$" | ||
# eslinth, shall we? urrfff | ||
# - repo: https://github.com/pre-commit/mirrors-eslint | ||
# rev: v8.47.0 | ||
# hooks: | ||
# - id: eslint |
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 @@ | ||
=== (ongoing) === | ||
|
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 @@ | ||
Everything in postgres, accessible via Django ORM, using | ||
postgres fullext search capabilites | ||
postgres fullext search capabilites |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.1" |
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,5 +1,20 @@ | ||
LANGUAGE_2_PGCONFIG = { | ||
"en": "english", | ||
"de": "german", | ||
"fr": "french", | ||
} | ||
from django.conf import settings | ||
|
||
POSTGRES_SEARCHINDEX = getattr( | ||
settings, | ||
"POSTGRES_SEARCHINDEX", | ||
{ | ||
"default": {}, | ||
}, | ||
) | ||
|
||
|
||
LANGUAGE_2_PGCONFIG = getattr( | ||
settings, | ||
"POSTGRES_SEARCHINDEX_LANGUAGE_2_PGCONFIG", | ||
{ | ||
"en": "english", | ||
"de": "german", | ||
"fr": "french", | ||
}, | ||
) |
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,37 +1,61 @@ | ||
# Generated by Django 3.2.21 on 2024-01-14 17:21 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('contenttypes', '0002_remove_content_type_name'), | ||
('sites', '0002_alter_domain_unique'), | ||
("contenttypes", "0002_remove_content_type_name"), | ||
("sites", "0002_alter_domain_unique"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='IndexEntry', | ||
name="IndexEntry", | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('modified_at', models.DateTimeField(auto_now=True)), | ||
('index_key', models.CharField(default='default', max_length=32)), | ||
('object_id', models.PositiveIntegerField()), | ||
('original_modified_at', models.DateTimeField(default=django.utils.timezone.now)), | ||
('title', models.CharField(max_length=1024)), | ||
('content', models.TextField(default='')), | ||
('url', models.TextField()), | ||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')), | ||
('site_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='sites.site')), | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("modified_at", models.DateTimeField(auto_now=True)), | ||
("index_key", models.CharField(default="default", max_length=32)), | ||
("object_id", models.PositiveIntegerField()), | ||
( | ||
"original_modified_at", | ||
models.DateTimeField(default=django.utils.timezone.now), | ||
), | ||
("title", models.CharField(max_length=1024)), | ||
("content", models.TextField(default="")), | ||
("url", models.TextField()), | ||
( | ||
"content_type", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="contenttypes.contenttype", | ||
), | ||
), | ||
( | ||
"site_id", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="sites.site", | ||
), | ||
), | ||
], | ||
options={ | ||
'abstract': False, | ||
"abstract": False, | ||
}, | ||
), | ||
] |
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 @@ | ||
__author__ = "benzkji" |
Oops, something went wrong.