Skip to content

Commit

Permalink
Merge pull request #48 from jackton1/feature/updated-the-readme
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
jackton1 authored Dec 6, 2019
2 parents 6cce2b2 + d07c230 commit cc4560a
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ from django.contrib import admin
from django.contrib.admin import ModelAdmin

@admin.register(TestModel)
class ModelToCloneAdmin(ModelAdmin):
class TestModelAdmin(ModelAdmin):
pass
```

Expand All @@ -168,7 +168,7 @@ to
from model_clone import CloneModelAdmin

@admin.register(TestModel)
class ModelToCloneAdmin(CloneModelAdmin):
class TestModelAdmin(CloneModelAdmin):
pass
```

Expand All @@ -180,11 +180,20 @@ class ModelToCloneAdmin(CloneModelAdmin):

![Screenshot](Duplicate-button.png)

##### SETTINGS
##### CLONE MODEL ADMIN CLASS PROPERTIES

```python

from model_clone import CloneModelAdmin

@admin.register(TestModel)
class TestModelAdmin(CloneModelAdmin):
# Enables/Disables the Duplicate action in the List view (Defaults to True)
include_duplicate_action = True
# Enables/Disables the Duplicate action in the Change view (Defaults to True)
include_duplicate_object_link = True
```

`include_duplicate_action`: Enables/Disables the Duplicate action in the List view (Defaults to True)
`include_duplicate_object_link`: Enables/Disables the Duplicate action in the Change view (Defaults to
True)

> :warning: NOTE: Ensure that `model_clone` is placed before `django.contrib.admin`
Expand Down

0 comments on commit cc4560a

Please sign in to comment.