I've got a model that has to check other objects before it is valid. If there are problems with the other objects, I want to report that and also give the template access to the offending objects. The regular errors object doesn't seem suited to this. Is there another way?
Here's a better explanation of what's going on:
Users are allowed to enter "events". If they would like to, they can associate these events with a "trip". However, if they do that, the time range specified for the trip needs to include the time of each of the individual events.
So, if the user goes to edit a trip and changes the time range, I need to go through all the events associated with the trip and make sure the times fall within the new range. If an event has a time outside that range, I'd like to give the user an error message letting them know what happened and even let them edit the event on the spot. So, I need a way to pass the actual event object (so I can get to all of its attributes, including ID) to the template, not just text about it.
Is there a good way to do this? I'm not even sure how to pass something more complex out of the model than just the standard text message.
Thanks!
Curtis H.