This repository has been archived by the owner on Sep 10, 2020. It is now read-only.
[general] added abstract models #13
Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1e42ae1
[general] added abstract models
lillopaco 429b3ff
[clean] clean code
lillopaco da630dc
Added requested changes
lillopaco d1aa9e3
[admin] added get_readonly_fields method
lillopaco 8e34e85
[models] delete base.py and added model
lillopaco e91c461
[requirements] added django-model-utils
lillopaco 9929df9
[migrations] added new migrations
lillopaco 62b5e4d
[migrations] added a new migrations
lillopaco c5acf30
[clean] clean models
lillopaco b73dd97
[general] added swapper
lillopaco c6c4f16
swapper
lillopaco bd2319b
[general] clean code
lillopaco 2fe3bd8
[sample_radius] added application test
lillopaco bf8c4d6
[django-swapper] added changes
lillopaco 7039ed5
[general] clean code
lillopaco a854e1b
[general] added swapper import
lillopaco 79d5d2d
[general] added modifications to test application
lillopaco 7c29a4d
[general] clean code
lillopaco eaf974c
[general] clean code
lillopaco 270fb5f
[general] added skipIf
lillopaco 9cd859b
[tests] Correct error
lillopaco 685ec3c
[general] added clean code
lillopaco c04348d
[general] correct import
lillopaco 40d0baf
[general] correct error
lillopaco 59b8f65
[general] clean code
lillopaco 02290da
[general] code clean
lillopaco e36c42c
[general]correct error
lillopaco 3103a95
[test] correct import
lillopaco 8700250
[general] correct import
lillopaco 1539552
[general] correct import
lillopaco 1e40453
[runtests] added sample_radius to runtests
lillopaco File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from django.contrib.admin import ModelAdmin | ||
|
||
|
||
class TimeStampedEditableAdmin(ModelAdmin): | ||
""" | ||
ModelAdmin for TimeStampedEditableModel | ||
""" | ||
def __init__(self, *args, **kwargs): | ||
self.readonly_fields += ('modified') | ||
super(TimeStampedEditableAdmin, self).__init__(*args, **kwargs) | ||
|
||
|
||
class AbstractRadiusGroupAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusGroupUsersAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusCheckAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusReplyAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusAccountingAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractNasAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusUserGroupAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusGroupReplyAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusGroupCheckAdmin(ModelAdmin): | ||
pass | ||
|
||
|
||
class AbstractRadiusPostAuthenticationAdmin(ModelAdmin): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
from model_utils.fields import AutoLastModifiedField | ||
|
||
|
||
class TimeStampedEditableAdmin(models.Model): | ||
|
||
# An abstract base class model that provides self-updating | ||
# modified fields. | ||
|
||
id = models.UUIDField(primary_key=True, editable=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, probably |
||
modified = AutoLastModifiedField(_('modified'), editable=True) | ||
|
||
class Meta: | ||
abstract = True |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the decorator version
@admin.register
of registration