seedcase-project / seedcase-sprout

Upload your research data to formally structure it for better, more reliable, and easier research.
https://sprout.seedcase-project.org/
MIT License
0 stars 0 forks source link

Prefer singular variable and property names for single objects #508

Closed martonvago closed 2 weeks ago

martonvago commented 2 months ago

Maybe a personal preference, but I find the plural for the model names a bit confusing. It seems to lead to naming variables in the plural (e.g. tables = Tables.objects.get(pk=table_id)) which actually refer to singular instances. Similarly, within models some properties use a plural name while actually pointing to a single object in a many-to-one relationship (e.g. one File(s) belongs to one Table(s), but this table is accessed through the tables property).

lwjohnst86 commented 2 months ago

We have the style guide say exactly what you describe: https://design.seedcase-project.org/style/naming#variables

So if it only contains one table, it should be called table. 💪🏻 So not just a personal preference 😁

K-Beicher commented 2 weeks ago

Moved this to me as I would suggest that we close it. It is mentioned in the style guide, and we also have a list of all the places where plural occurs where it probably shouldn't (#509)