# Set ManyToMany value that is NOT in ModelForm

**URL:** <https://forum.djangoproject.com/t/set-manytomany-value-that-is-not-in-modelform/28949>\
**Category:** Using the ORM\
**Created:** [March 11, 2024, 9:57am UTC](https://forum.djangoproject.com/t/set-manytomany-value-that-is-not-in-modelform/28949 "2024-03-11T09:57:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 11, 2024, 4:05pm UTC](https://forum.djangoproject.com/t/set-manytomany-value-that-is-not-in-modelform/28949/4 "2024-03-11T16:05:46Z")

</div>

> [@nmilner1234](#):
>
> ```auto
> print (dir(self.object))
> 
> ```

Where _exactly_ in your view do you have that line?

You set a model field value the same regardless of where you set it:  
`instance.field_name = value`

However, keep in mind that a ManyToManyField is _not_ a field in the model. It’s a reference to a relationship manager for data stored in a “through” table that establishes the connection between the two models. Adding a value to a many-to-many relationship does **not** affect either of the two related models. It’s _only_ the through table that is being changed.

---

_[View the full topic](https://forum.djangoproject.com/t/set-manytomany-value-that-is-not-in-modelform/28949)._
