Getting just the ID of a foreign key requires full object
Poking around the code, it's possible to get something like the Django flavor by having a new descriptor that just returns `_data[self.att_name]` and add it to the object during the `_new_()` call of `ForeignKeyField`
 This query will join `Post` and `User` and eagerly fetch the post's associated user object.

``` python
all_posts_with_user = Post.select(Post, User).join(User).execute()
```

The other query you shared below will _not_ eagerly fetch the user, and will trigger a query when you attempt to access the `post.user` attribute.

``` python
all_posts = Post.select().execute()
```

As you noted in your second comment, you can retrieve the related object's ID by looking at `post._data['user']`. Rather than modifying the code to add a new attribute, you can either subclass `ForeignKeyField` with your own implementation or write a `property` on your model class that will lookup the ID, e.g.

``` python
class Post(Model):
    # ... fields ...
    @property
    def author_id(self):
        return self._data['author']
```
 Yeah, eagerly was the wrong word to use - I meant that it fetched the entire object before it had to :)

Anyway, thanks for merging it in! :)

Hey there,

For illustrative purposes, lets use the following model:

``` python
class User(Model):
    name = CharField(max_length=50)

class Post(Model):
    author = ForeignKeyField(User)
    text = TextField()

all_posts_with_user = Post.select(Post, User).join(User).execute()
all_posts = Post.select().execute()
```

The issue I am seeing is that on `all_posts`, Peewee will do an eager lookup in the database as soon as `__getattr__` is hit on the author field's `RelationDescriptor`, which is unnecessary when you just want to work with the related object's id (like when doing any sort of client-side aggregate).

Django solves this by having an additional attribute of `modelname_id`. In our case, `Post` will have a `author_id` attribute in addition to the `author` attribute.

Would be nice to having something simiar in Peewee :)
