title: How to fetch foreign key relationships in mongoengine
body: <p>I have the following two models.</p>
  
  <pre><code>class URL(mongoengine.Document):
      codes = mongoengine.ListField(mongoengine.IntField(required=True),
                 verbose_name='Codes')
      name = mongoengine.StringField(max_length=255, required=True)
  
  class BytesForURL(mongoengine.Document):
      url = mongoengine.ReferenceField(URL)
      value = mongoengine.FloatField(required=True)
      timestamp = mongoengine.DateTimeField(required=True)
  </code></pre>
  
  <p>I need to get the data of <code>BytesForURL</code> given a <code>url</code> name within a time range. How do I query for that.</p>
  
  <pre><code>bytes = mongo_models.BytesForURL.objects(timestamp__gte=from_time,
                                                    timestamp__lte=to_time, )
  
  for byte in bytes:
      print byte.value, byte.timestamp
  </code></pre>
  
  <p>But how do I pass get this value for a url. Any help?</p>