Skip to content

Commit 447c035

Browse files
committed
Add journal
1 parent ed94424 commit 447c035

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1371
-251
lines changed

.dockerignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,3 @@ dmypy.json
129129

130130
# editors
131131
.idea/
132-
133-
# In app data
134-
apps/cap_feed/geographical/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.12-slim-bullseye as base
2+
3+
LABEL maintainer="Togglecorp Dev"
4+
5+
ENV PYTHONUNBUFFERED 1
6+
7+
WORKDIR /code
8+
9+
COPY pyproject.toml poetry.lock /code/
10+
11+
RUN apt-get update -y \
12+
&& apt-get install -y --no-install-recommends \
13+
# Build required packages
14+
gcc libc-dev gdal-bin libproj-dev \
15+
# Helper packages
16+
wait-for-it \
17+
# Upgrade pip and install python packages for code
18+
&& pip install --upgrade --no-cache-dir pip poetry \
19+
&& poetry --version \
20+
# Configure to use system instead of virtualenvs
21+
&& poetry config virtualenvs.create false \
22+
&& poetry install --no-root \
23+
# Clean-up
24+
&& pip uninstall -y poetry virtualenv-clone virtualenv \
25+
&& apt-get remove -y gcc libc-dev libproj-dev \
26+
&& apt-get autoremove -y \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
30+
COPY . /code/

apps/common/management/__init__.py

Whitespace-only changes.

apps/common/management/commands/__init__.py

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import argparse
2+
3+
from django.core.management.base import BaseCommand
4+
from strawberry.printer import print_schema
5+
6+
from main.graphql.schema import schema
7+
8+
9+
class Command(BaseCommand):
10+
help = "Create schema.graphql file"
11+
12+
def add_arguments(self, parser):
13+
parser.add_argument(
14+
"--out",
15+
type=argparse.FileType("w"),
16+
default="schema.graphql",
17+
)
18+
19+
def handle(self, *args, **options):
20+
file = options["out"]
21+
file.write(print_schema(schema))
22+
file.close()
23+
self.stdout.write(self.style.SUCCESS(f"{file.name} file generated"))

apps/common/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ class UserResource(models.Model):
2323
created_by_id: int
2424
modified_by_id: int
2525

26-
class Meta(models.Model.Meta):
26+
class Meta: # type: ignore[reportIncompatibleVariableOverride]
2727
abstract = True
2828
ordering = ["-id"]

apps/common/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class UserResourceTypeMixin:
1818

1919
@strawberry_django.field
2020
async def created_by(self, root: UserResource, info: Info) -> UserType:
21-
return info.context.dl.user.load_user.load(root.created_by_id)
21+
return await info.context.dl.user.load_user.load(root.created_by_id)
2222

2323
@strawberry_django.field
2424
async def modified_by(self, root: UserResource, info: Info) -> UserType:
25-
return info.context.dl.user.load_user.load(root.modified_by_id)
25+
return await info.context.dl.user.load_user.load(root.modified_by_id)
2626

2727

2828
class ClientIdMixin:

apps/journal/__init__.py

Whitespace-only changes.

apps/journal/admin.py

Whitespace-only changes.

0 commit comments

Comments
 (0)