Skip to content

Commit ba9f7c2

Browse files
init
0 parents  commit ba9f7c2

File tree

116 files changed

+31804
-0
lines changed

Some content is hidden

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

116 files changed

+31804
-0
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.DS_Store
2+
.idea
3+
.vscode
4+
db/*
5+
venv
6+
__pycache__
7+
migrations
8+
file_store
9+
10+
/node_modules
11+
/.pnp
12+
.pnp.js
13+
14+
/coverage
15+
16+
/build
17+
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.DS_Store
2+
.idea
3+
.vscode
4+
db
5+
venv
6+
__pycache__
7+
migrations
8+
file_store
9+
10+
node_modules
11+
.pnp
12+
pnp.js
13+
14+
coverage
15+
16+
build
17+
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*

back/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:latest
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
postgresql-client \
6+
gcc \
7+
python3-dev \
8+
musl-dev \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
WORKDIR /app
12+
COPY requirements.txt ./
13+
RUN pip install -r requirements.txt
14+
EXPOSE 8000
15+
16+
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

back/proj_back/api/__init__.py

Whitespace-only changes.

back/proj_back/api/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ApiConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'api'

back/proj_back/api/urls.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.urls import path, include
2+
3+
def q(request, path):
4+
from django.http import HttpResponse
5+
return HttpResponse('ok')
6+
7+
8+
9+
urlpatterns = [
10+
path('users/', include('user.urls')),
11+
path('projects/', include('project.urls')),
12+
path('files/', include('file.urls'))
13+
]

back/proj_back/attribute/__init__.py

Whitespace-only changes.

back/proj_back/attribute/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from django.contrib import admin
2+
from .models import Attribute
3+
4+
admin.site.register(Attribute)

back/proj_back/attribute/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AttributesConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'attribute'

back/proj_back/attribute/models.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from django.db import models
2+
from tree_queries.models import TreeNode
3+
4+
# Fetch nodes in depth-first search order: .objects.with_tree_fields()
5+
# All nodes will have the tree_path, tree_ordering and tree_depth attributes.
6+
# Fetch any node: .objects.order_by("?").first()
7+
# Fetch all ancestors starting from the root: .ancestors(include_self=True)
8+
# Fetch direct children: .children.with_tree_fields()
9+
# Fetch all descendants in depth-first search order, including self: .descendants(include_self=True)
10+
# Temporarily override the ordering by siblings: Node.objects.order_siblings_by("id")
11+
# Breadth-first search: .objects.with_tree_fields().extra(order_by=["__tree.tree_depth", "__tree.tree_ordering"])
12+
# Filter by depth: .objects.with_tree_fields().extra(where=["__tree.tree_depth <= %s"], params=[1])
13+
class Attribute(TreeNode):
14+
name = models.CharField(max_length=255)
15+
project = models.ForeignKey('project.Project', on_delete=models.DO_NOTHING)
16+
level = models.ForeignKey('attribute.Level', on_delete=models.DO_NOTHING)
17+
18+
class Meta: db_table = 'attribute'
19+
20+
def __str__(self): return self.name
21+
22+
23+
class Level(TreeNode):
24+
uid = models.BigIntegerField()
25+
name = models.CharField(max_length=255)
26+
project = models.ForeignKey('project.Project', on_delete=models.DO_NOTHING)
27+
28+
class Meta: db_table = 'level'
29+
30+
def __str__(self): return self.name

0 commit comments

Comments
 (0)