I\'m new to Django and looking for best practices on the code I just wrote (below). The code currently exists in my view.py and simply creates a new event. Being familiar with o
I think this looks great. You have followed the conventions from the docs nicely.
Moving request.user
to a model would certainly be an anti pattern - a views function is to serve in the request/response loop, so access this property here makes sense. Models know nothing of requests/responses, so it's correct keep these decoupled from any view behavior.
Only thing that I noticed was creating a category
variable out only to be used in construction of the Event
, very minor.