# How to keep belongsTo and hasMany Async?

**URL:** https://discuss.emberjs.com/t/how-to-keep-belongsto-and-hasmany-async/6812
**Category:** Uncategorized
**Created:** [November 30, 2014, 10:01am UTC](https://discuss.emberjs.com/t/how-to-keep-belongsto-and-hasmany-async/6812 "2014-11-30T10:01:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Laipak](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/laipak/32/9821_2.png) [@Laipak](https://discuss.emberjs.com/u/Laipak)
#### Post date: [November 30, 2014, 10:01am UTC](https://discuss.emberjs.com/t/how-to-keep-belongsto-and-hasmany-async/6812/1 "2014-11-30T10:01:19Z")

</div>

So basically I have a project model which has many todos 0…n:

```
App.Project = DS.Model.extend({
  title: DS.attr('string'),
  date: DS.attr('date', {defaultValue: null}),
  tag: DS.attr('string', {defaultValue: null}),
  todos: DS.hasMany('todo', {async: true})
});

```

and a todo model which belongs to a project 0…1:

```
App.Todo = DS.Model.extend({
  title: DS.attr('string'),
  date: DS.attr('date', {defaultValue: null}),
  project: DS.belongsTo('project', {async: true})
});

```

So I can simply get which project todo belongs to :

```
{{#each todo in model}}
     {{todo.title}}
     {{todo.project.title}}
{{/each}}

```

and set which project todo belongs to :

```
var todo = this.store.createRecord('todo');
this.store.find('project', 1).then(function(project){
  todo.set('project', project);
  todo.save();
});

```

But how do we keep the other side **( the project model ) to have the todo in it hasMany attr?**

Do we need to set in the project model, or is there any method in keeping them async?
