Skip to content

Commit

Permalink
Collect object_types
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenhesselink committed Jun 13, 2024
1 parent dcec791 commit 8c5a43a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions djlsp/scripts/django-collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from django.template.engine import Engine
from django.template.library import InvalidTemplateLibrary
from django.template.utils import get_app_template_dirs
from django.test import RequestFactory
from django.urls import URLPattern, URLResolver

# Some tags are added with a Node, like end*, elif else.
Expand Down Expand Up @@ -112,6 +113,19 @@ def get_file_watcher_globs():
return patterns


def get_model_data():
pass


def get_object_types():
models = apps.get_models()
object_types = {}
for model in models:
model_path = model.__module__ + "." + model.__name__
object_types[model_path] = {field.name: None for field in model._meta.fields}
return object_types


def get_static_files():
# TODO: Add option to ignore some static folders
# (like static that is generated with a JS bundler)
Expand Down Expand Up @@ -282,6 +296,7 @@ def collect_project_data():
"urls": get_urls(),
"libraries": get_libraries(),
"templates": get_templates(),
"object_types": get_object_types(),
}


Expand Down

0 comments on commit 8c5a43a

Please sign in to comment.