mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 21:35:01 -02:30
Resolve default ordering warnings from tests
This commit is contained in:
@@ -30,6 +30,7 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
|
||||
|
||||
class Meta(object):
|
||||
app_label = 'main'
|
||||
ordering = ('id',)
|
||||
|
||||
diff_mode = models.BooleanField(
|
||||
default=False,
|
||||
|
||||
@@ -1312,6 +1312,7 @@ class CredentialInputSource(PrimordialModel):
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = (('target_credential', 'input_field_name'),)
|
||||
ordering = ('target_credential', 'source_credential', 'input_field_name',)
|
||||
|
||||
target_credential = models.ForeignKey(
|
||||
'Credential',
|
||||
|
||||
@@ -98,6 +98,7 @@ class Instance(HasPolicyEditsMixin, BaseModel):
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
ordering = ("hostname",)
|
||||
|
||||
POLICY_FIELDS = frozenset(('managed_by_policy', 'hostname', 'capacity_adjustment'))
|
||||
|
||||
|
||||
@@ -1451,6 +1451,7 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions, CustomVirtualE
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
ordering = ('inventory', 'name')
|
||||
|
||||
inventory = models.ForeignKey(
|
||||
'Inventory',
|
||||
@@ -1680,6 +1681,7 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin,
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
ordering = ('inventory', 'name')
|
||||
|
||||
inventory = models.ForeignKey(
|
||||
'Inventory',
|
||||
|
||||
@@ -50,6 +50,7 @@ class NotificationTemplate(CommonModelNameNotUnique):
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = ('organization', 'name')
|
||||
ordering = ("name",)
|
||||
|
||||
organization = models.ForeignKey(
|
||||
'Organization',
|
||||
|
||||
@@ -28,6 +28,7 @@ class OAuth2Application(AbstractApplication):
|
||||
app_label = 'main'
|
||||
verbose_name = _('application')
|
||||
unique_together = (("name", "organization"),)
|
||||
ordering = ('organization', 'name')
|
||||
|
||||
CLIENT_CONFIDENTIAL = "confidential"
|
||||
CLIENT_PUBLIC = "public"
|
||||
@@ -89,6 +90,7 @@ class OAuth2AccessToken(AbstractAccessToken):
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
verbose_name = _('access token')
|
||||
ordering = ('id',)
|
||||
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
|
||||
@@ -138,6 +138,7 @@ class Role(models.Model):
|
||||
index_together = [
|
||||
("content_type", "object_id")
|
||||
]
|
||||
ordering = ("content_type", "object_id")
|
||||
|
||||
role_field = models.TextField(null=False)
|
||||
singleton_name = models.TextField(null=True, default=None, db_index=True, unique=True)
|
||||
|
||||
@@ -98,6 +98,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
ordering = ('name',)
|
||||
# unique_together here is intentionally commented out. Please make sure sub-classes of this model
|
||||
# contain at least this uniqueness restriction: SOFT_UNIQUE_TOGETHER = [('polymorphic_ctype', 'name')]
|
||||
#unique_together = [('polymorphic_ctype', 'name')]
|
||||
@@ -556,6 +557,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
ordering = ('id',)
|
||||
|
||||
old_pk = models.PositiveIntegerField(
|
||||
null=True,
|
||||
|
||||
Reference in New Issue
Block a user