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

Reorganize table/model/view file #181

Open
y3pio opened this issue Jan 12, 2025 · 3 comments
Open

Reorganize table/model/view file #181

y3pio opened this issue Jan 12, 2025 · 3 comments
Assignees
Labels
cleanup Code cleanup, etc.

Comments

@y3pio
Copy link
Collaborator

y3pio commented Jan 12, 2025

Right now, seems like the tables.py, models.py and views.py are just single files containing ALL the table, model and view methods used to render the different pages/tables/views etc... -- Having all the methods in a single file makes it a bit harder to shift through the code and read, in addition to making the files a bit bloated.

Creating this code cleanup issue to organize the files a bit into their respective table/model/view folders/files to make it a bit easier to find the file/method responsible for rendering a particular view.

@y3pio y3pio added the cleanup Code cleanup, etc. label Jan 12, 2025
@y3pio y3pio self-assigned this Jan 13, 2025
@khatchad khatchad changed the title Reorganize table/model/view file. Reorganize table/model/view file Jan 13, 2025
@khatchad
Copy link
Member

Right now, seems like the tables.py, models.py and views.py are just single files containing ALL the table, model and view methods used to render the different pages/tables/views etc... -- Having all the methods in a single file makes it a bit harder to shift through the code and read, in addition to making the files a bit bloated.

I think that's a Django thing. Looks like you can separate them in a models package: https://docs.djangoproject.com/en/5.1/topics/db/models/#organizing-models-in-a-package.

@y3pio
Copy link
Collaborator Author

y3pio commented Jan 15, 2025

Yup, just came across that doc the other day. Not too versed with django package management, was running into some import error when trying to split it up by packages. Will keep looking into this and organizing it as best as I can.

@khatchad
Copy link
Member

I think it would be OK to keep it as one file. It's pretty common in Python AFAIK to have long files since Python considers a file a module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanup, etc.
Projects
None yet
Development

No branches or pull requests

2 participants