You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.
When you write a blog post, you can change the blog post author if you want, and we should have that for events too. This would be the event "owner".
The steps to do this would be:
add a new field on the Event model in app/models/Event.py called owner (similar to the creator field).
add some code in the clean method that ensures that both the owner field is populated, setting owner to creator if owner is None.
add a new SelectField to CreateEventForm (app/forms/CreateEventForm.py) (see app/forms/CreateBlogPostForm.py).
populate it dynamically with the users and set the default to be the current user in app/routes/admin/events.py. Should model after this code in app/routes/admin/posts.py:
Edit the dictionary literals in DataBuilder in app/lib/events.py so that converting between forms and events also passes along the value for the owner. Note that the key will just be the fieldname, but the value may be something more like this, taken from app/routes/admin/posts.py :
Issue by danrschlosser
Friday Oct 24, 2014 at 06:27 GMT
Originally opened as schlosser/eventum#93
When you write a blog post, you can change the blog post author if you want, and we should have that for events too. This would be the event "owner".
The steps to do this would be:
add a new field on the Event model in
app/models/Event.py
calledowner
(similar to thecreator
field).add some code in the
clean
method that ensures that both theowner
field is populated, settingowner
tocreator
ifowner
isNone
.add a new
SelectField
toCreateEventForm
(app/forms/CreateEventForm.py
) (seeapp/forms/CreateBlogPostForm.py
).populate it dynamically with the users and set the default to be the current user in
app/routes/admin/events.py
. Should model after this code inapp/routes/admin/posts.py
:Render the field in
app/templates/admin/events/create.html
to show the select field. See this code inapp/templates/admin/posts/create.html
:Edit the dictionary literals in
DataBuilder
inapp/lib/events.py
so that converting between forms and events also passes along the value for the owner. Note that the key will just be the fieldname, but the value may be something more like this, taken fromapp/routes/admin/posts.py
:The text was updated successfully, but these errors were encountered: