Skip to content

Commit

Permalink
Updated docs (#316)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] committed May 8, 2021
1 parent 4a69be7 commit 674fad1
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ Create copies of a model instance with explicit control on how the instance shou

* [Installation](#installation)
* [Usage](#usage)
* [Inheriting from `CloneModel` or `CloneMixin`](#inheriting-from-clonemodel-or-clonemixin)
* [Subclassing the `CloneModel`](#subclassing-the-clonemodel)
* [Using the `CloneMixin`](#using-the-clonemixin)
* [Subclassing the `CloneModel`](#subclassing-the-clonemodel)
* [Using the `CloneMixin`](#using-the-clonemixin)
* [Duplicating a model instance](#duplicating-a-model-instance)
* [Bulk cloning a model](#bulk-cloning-a-model)
* [CloneMixin attributes](#clonemixin-attributes)
Expand All @@ -44,9 +43,27 @@ pip install django-clone

## Usage

### Inheriting from `CloneModel` or `CloneMixin`
**CHANGE**

#### Subclassing the `CloneModel`
```python
from django.db import models

class MyModel(models.Model):
title = models.CharField(max_length=200)
```

**TO**

```python
from django.db import models
from model_clone import CloneModel

class MyModel(CloneModel):
title = models.CharField(max_length=200)
```


### Subclassing the `CloneModel`

```python
from django.db import models
Expand All @@ -67,7 +84,7 @@ class Tags(models.Model): # To enable cloning tags directly use `CloneModel` a
return _(self.name)
```

#### Using the `CloneMixin`
### Using the `CloneMixin`

```python
from django.db import models
Expand Down

0 comments on commit 674fad1

Please sign in to comment.