hmarr/mongoengine — Issue #441: Maximum recursion depth exceeded with 0.5.2
Author: mahmoudhossam
Created: 2012-02-26 16:10:22+00:00
State: open

I have a `Post` class that looks like this:

```python

class Post(Document):
title = StringField(required=True)
content = StringField(required=True)
date = DateTimeField(required=True)
slug = StringField(required=True)

```

I can save objects to the database just fine, but when I try to get a specific post, it gives me a `RuntimeError`.

This is the code I'm using:

```python
def get_post(year, month, day, slug):
date = date(year, month, day)
posts = Post.objects(date=date)
for i in posts:
if i.slug == slug:
return i