Skip to content

Commit

Permalink
Merge pull request #13 from fourdigits/collect-object-types
Browse files Browse the repository at this point in the history
Collect object_types
  • Loading branch information
krukas authored Jun 13, 2024
2 parents dcec791 + b54b3d2 commit a496e4a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions djlsp/scripts/django-collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ def get_file_watcher_globs():
return patterns


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 +291,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 a496e4a

Please sign in to comment.