-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Client table #148
Comments
Hello, I'd like to work on this issue. Can it be assigned to me ? Do you want other fields than client_name ? I assume that we'll need to create crud operations to this table, and maybe an edit_site_client function ? |
I think client name is good. Perhaps tge created mixin would be good too Yea, create abd edit function would be great |
Add clientSQL in splmodels, with client_name Mapped relationships between Client and Site
By browsing through the alembic history, I found that a client table used to exist, and has been dropped when the User and SiteGroup tables were created. Are you sure you want to reintroduce it ? If so, can the client_uuid field in the site table can be nullalble ? If not, this will entail constraints on the production process so as not to block everything. |
yea your are right @Bvr4, we used to have it, and then switched to user and sites. We would like it back, and yes, making it nullable would be great, and then much easier to role out |
It would be great to have a few functions
Feel free to split these up into different issues/ PRs if you want too, no pressure |
added create_client and edit_client functions, and related tests. edited PVSiteEditMetadata pydantic model, so edit_site function can update the client_uuid. edited create_site function, so it can set the client_uuid.
OK, I was working on create_client and edit_client function today. I put them in write/user_and_site.py. But I wonder if it would be better in another file, like write/client.py ? |
Thanks so much for this @Bvr4 . Yea I would go for a different file |
Moved the client functions from user_and_site.py to client.py
Added get_client_by_name function, and related tests. This function can create a new client if it doesn't exist.
* Add client table (#148) Add clientSQL in splmodels, with client_name Mapped relationships between Client and Site * Alembic migration : Add client table (#148) * Fix: make client_uuid nullable in Site table (#148) * Add read function get_sites_by_client_name and tests (#148) add function, tests, and edited sites fixture in conftest in order to have client informations in tests samples * update readme Database schema (#148) * Add create_client and edit_client functions (#148) added create_client and edit_client functions, and related tests. edited PVSiteEditMetadata pydantic model, so edit_site function can update the client_uuid. edited create_site function, so it can set the client_uuid. * Move create_client and edit_client to a new file (#148) Moved the client functions from user_and_site.py to client.py * Add get_client_by_name function (#148) Added get_client_by_name function, and related tests. This function can create a new client if it doesn't exist. * Add assign_site_to_client function (#148) * Adjust alembic migration (#148) --------- Co-authored-by: Peter Dudfield <[email protected]>
Thanks for you work on this @Bvr4 . Would you like to do the extention on this, this would be to add an optional 0-n join with users aswell? |
Yes, with pleasure |
Thank you. Its probably worth doing user_site_groups too as an optional 0-n join with client, as well as an assign function. I think this would then cover all cases |
Just to be sure, a client can be related with multiple users. Can a user be related with more than one client ? |
Possibly, like OCF users, but perhaps could we could start with a user can only be part of one client, and then we can add to it, if we need it |
Thanks @Bvr4 for making an issue, perhaps Ill code this one, if thats ok with you? |
Yes if you prefer |
Detailed Description
it would be nice to have a client table, which is joined to the sites table
Context
Possible Implementation
The text was updated successfully, but these errors were encountered: