Query Content Type Based on Value in Field

Topics: General
Nov 16, 2011 at 4:35 PM

I created a Content Type, called Event, that has an EventPart but no EventPartRecord.

The Event Content Type has a field, called Date, which is a Contrib.DateTimeField and represents the date of the event.

I need to query the events that happen on a particular date or date range and I am not sure how to do that since the date is stored in the Contrib.DateTimeField. I assume I need to do some type of join, but am unsure what that would look like.

Would really appreciate if someone could post a sample query on how to perform this task.



Nov 16, 2011 at 4:36 PM

Impossible without the new Projector module.

You could use the search API to query it, as the fields are indexed, but might lead to other issues.

Nov 16, 2011 at 4:37 PM

Well, impossible, you can still do it in memory once the fields are loaded. They are stored in an XML document attached to the Content Items (InfosetPart)

Nov 16, 2011 at 4:51 PM

I was afraid you were going to say that :)

I'll just stick the date in a new EventPartRecord.

Thanks, Sebastien.