Skip to content

add table comment to generated code #215

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

PaleNeutron
Copy link

No description provided.

@PaleNeutron
Copy link
Author

Adding comment to class doc string will help IDE to provide useful hints.

@agronholm
Copy link
Owner

This needs a rebase against master, tests to cover the new functionality, and a changelog entry.

@sheinbergon sheinbergon self-assigned this Jun 1, 2025
@sheinbergon sheinbergon added this to the 3.1 milestone Jun 1, 2025
Copy link
Owner

@agronholm agronholm left a comment

Choose a reason for hiding this comment

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

This PR doesn't actually add the comment back to the table metadata. Should it?

@@ -1139,6 +1141,10 @@ def render_class_declaration(self, model: ModelClass) -> str:
)
return f"class {model.name}({parent_class_name}):"

def render_table_comment(self, model: ModelClass) -> str:
if model.table.comment:
return f'"""{model.table.comment}"""'
Copy link
Owner

@agronholm agronholm Jun 10, 2025

Choose a reason for hiding this comment

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

No wrapping for long docstrings then...?

Comment on lines +1105 to 1106
sections.append(comments)
# Render class variables / special declarations
Copy link
Owner

Choose a reason for hiding this comment

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

Add a blank line after a control block ends.

Suggested change
sections.append(comments)
# Render class variables / special declarations
sections.append(comments)
# Render class variables / special declarations

@sheinbergon sheinbergon removed this from the 3.1 milestone Jun 10, 2025
@sheinbergon
Copy link
Collaborator

This PR doesn't actually add the comment back to the table metadata. Should it?

I have to review this PR. it's very old. I've moved it out of 3.1 for the time being , as with what little time I have left, I'd like to focus on :

  • Making sure the DOMAIN issue is behind us
  • Finally fixing the broken generated bindings when no primery key is present issue.

We'll tackle this one in future milestones 😄

@sheinbergon sheinbergon added this to the backlog milestone Jun 10, 2025
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.

3 participants