# Manipulating Models

## Get model

```python
MyModel = apps.get_moel('app_name', 'MyModel')
```

## Get field values

```python
for model_obj in MyModel.objects.all():
  model_obj.field_name # get value of field name of obj
  Model.objects.get(pk=...)

  model_obj_save() # make sure you save after manipulating anything
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lauradang.gitbook.io/notes/web/django/manipulating-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
