These are chat archives for django/django
authorfield. I'll look into the save function more, but it doesn't seem to have the capability to get the
request.userobject in the model.
@ajostergaard So I tried the:
def save_model(self, request, obj, form, change): obj.author = request.user super().save_model(request, obj, form, change)
It's not saving to the database though. It just keeps the same value from before it was edited...
disabledattribute for model fields. But I'm just getting a
unexpected keyword argumenterror. How do you set the input field to disabled instead of excluding it?
Formand instantiating it in a
View) be a good practice? I don't actually want a
FormView, I am simply making a POST request and data should be validated
FormView, and are just setting up a form to call a
POSTrequest, I'd say do it that way. I'm not sure if there are validations or security vulnerabilities doing that though.