sst/storage_templates #3

Merged
sst merged 5 commits from sst/storage_templates into develop 2024-11-15 22:58:18 +01:00
Collaborator

I was trying to add kind of a templating system when adding storages - so sub-storage structure is automatically copied from the template.

...to e.g. generate the same kind of assortment box.

...had to change the way you added a user search in this form to get it done - now the user is found using the same mechanism as all the rest. I even added a method to add the @ back in...

I was trying to add kind of a templating system when adding storages - so sub-storage structure is automatically copied from the template. ...to e.g. generate the same kind of assortment box. ...had to change the way you added a user search in this form to get it done - now the user is found using the same mechanism as all the rest. I even added a method to add the @ back in...
mhu was assigned by sst 2024-11-10 21:17:18 +01:00
sst added 3 commits 2024-11-10 21:17:18 +01:00
sst added 1 commit 2024-11-10 21:21:11 +01:00
mhu changed target branch from master to develop 2024-11-15 22:05:32 +01:00
Owner

I changed the pull request to be merged into develop.
If we really start to work on that together, I guess it makes sense to have some sort of separation between develop and actually stable versions on master.

I changed the pull request to be merged into develop. If we really start to work on that together, I guess it makes sense to have some sort of separation between develop and actually stable versions on master.
Owner

Another test comment to test whether emails are actually sent. @sst

Another test comment to test whether emails are actually sent. @sst
mhu approved these changes 2024-11-15 22:51:08 +01:00
@ -6,3 +7,2 @@
class Meta:
model = User
fields = ['username', 'email', 'first_name', 'last_name', 'groups']
model = get_user_model()
Owner

Mh. According to https://stackoverflow.com/a/24630589/5761843
another way of retreiving the user model should be used.

get_user_model cannot guarantee that the User model is already loaded into the app cache. It might work in your specific setup, but it is a hit-and-miss scenario. If you change some settings (e.g. the order of INSTALLED_APPS) it might very well break the import and you will have to spend additional time debugging.

settings.AUTH_USER_MODEL will pass a string as the foreign key model, and if the retrieval of the model class fails at the time this foreign key is imported, the retrieval will be delayed until all model classes are loaded into the cache.

Mh. According to https://stackoverflow.com/a/24630589/5761843 another way of retreiving the user model should be used. > get_user_model cannot guarantee that the User model is already loaded into the app cache. It might work in your specific setup, but it is a hit-and-miss scenario. If you change some settings (e.g. the order of INSTALLED_APPS) it might very well break the import and you will have to spend additional time debugging. >settings.AUTH_USER_MODEL will pass a string as the foreign key model, and if the retrieval of the model class fails at the time this foreign key is imported, the retrieval will be delayed until all model classes are loaded into the cache.
Owner

Ah. shit. Nevermind. Very old post. They changed that way back in django 1.xxx

Ah. shit. Nevermind. Very old post. They changed that way back in django 1.xxx
mhu marked this conversation as resolved
@ -593,6 +598,8 @@ class StockViewDetail(LoginRequiredMixin, BaseTemplateMixin, DetailView):
if 'submit-add-storage' in request.POST:
return self.handle_add_storage_post(request, **kwargs)
if 'submit-change-storage' in request.POST:
Owner

Any reason, that is not an elif? @sst

Any reason, that is not an elif? @sst
sst marked this conversation as resolved
mhu requested review from mhu 2024-11-15 22:51:44 +01:00
sst added 1 commit 2024-11-15 22:55:35 +01:00
sst closed this pull request 2024-11-15 22:57:24 +01:00
sst reopened this pull request 2024-11-15 22:58:06 +01:00
sst merged commit 50ecaa2cc0 into develop 2024-11-15 22:58:18 +01:00
sst deleted branch sst/storage_templates 2024-11-15 22:58:18 +01:00
Sign in to join this conversation.
No reviewers
mhu
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mhu/shimatta-kenkyusho#3
No description provided.