Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Extend schema json #961

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

✨ Extend schema json #961

wants to merge 10 commits into from

Conversation

fredericenard
Copy link
Contributor

@fredericenard fredericenard commented Feb 4, 2025

  • We need a robust way to flag user defined link tables (see this slack thread + private discussion with @falexwolf)
  • This discussion with @Zethson mades me realized some fields are missing in the schema json (primary key flag, maybe also the field used for default ordering and title displayed in the UI).

Copy link

github-actions bot commented Feb 4, 2025

@github-actions github-actions bot temporarily deployed to pull request February 4, 2025 21:32 Inactive
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.96%. Comparing base (e6e5b71) to head (66f760c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #961      +/-   ##
==========================================
- Coverage   83.99%   83.96%   -0.03%     
==========================================
  Files          43       43              
  Lines        3536     3549      +13     
==========================================
+ Hits         2970     2980      +10     
- Misses        566      569       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot temporarily deployed to pull request February 4, 2025 21:40 Inactive
self.model = model
self.class_name = model.__name__
self.module_name = module_name
self.model_name = model._meta.model_name
self.table_name = model._meta.db_table
self.included_modules = included_modules
self.fields = self._get_fields_metadata(self.model)
self.is_link_table = issubclass(model, LinkORM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we had this line already since the beginning. Good that we track this now!

@falexwolf
Copy link
Member

Great! 😄

Can you please also add a test for a link table example?

And: can we also track whether a field is editable or not to display "edit" buttons on the UI? E.g. here: https://github.com/laminlabs/lamindb/blob/8b748245c200bfa00f3cf8d969d4f097c7615f20/lamindb/models.py#L842 and
https://github.com/laminlabs/lamindb/blob/8b748245c200bfa00f3cf8d969d4f097c7615f20/lamindb/models.py#L853

@github-actions github-actions bot temporarily deployed to pull request February 5, 2025 09:15 Inactive
@github-actions github-actions bot temporarily deployed to pull request February 5, 2025 11:21 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants