Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Rename ProductAttribute to Attribute in docstrings and help texts

Pacu2e2523744fe54
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py
index 0c66b80f75..a9c3136cff 100644
--- a/saleor/core/utils/random_data.py
+++ b/saleor/core/utils/random_data.py
@@ -172,8 +172,8 @@ def get_variant_combinations(product):
# Size has available values: [S, M], Color has values [Red, Green]
# All combinations will be generated (S, Red), (S, Green), (M, Red),
# (M, Green)
- # Output is list of dicts, where key is product attribute id and value is
- # attribute value id. Casted to string.
+ # Output is list of dicts, where key is Attribute id and value is
+ # AttributeValue id. Casted to string.
variant_attr_map = {
attr: attr.values.all()
for attr in product.product_type.variant_attributes.all()}
diff --git a/saleor/dashboard/product/filters.py b/saleor/dashboard/product/filters.py
index e228da62c5..e9441a22de 100644
--- a/saleor/dashboard/product/filters.py
+++ b/saleor/dashboard/product/filters.py
@@ -64,10 +64,10 @@ class ProductFilter(SortedFilterSet):
class AttributeFilter(SortedFilterSet):
name = CharFilter(
- label=pgettext_lazy('Product attribute list filter label', 'Name'),
+ label=pgettext_lazy('Attribute list filter label', 'Name'),
lookup_expr='icontains')
sort_by = OrderingFilter(
- label=pgettext_lazy('Product attribute list filter label', 'Sort by'),
+ label=pgettext_lazy('Attribute list filter label', 'Sort by'),
fields=PRODUCT_TYPE_SORT_BY_FIELDS.keys(),
field_labels=PRODUCT_TYPE_SORT_BY_FIELDS)
@@ -78,8 +78,7 @@ class AttributeFilter(SortedFilterSet):
def get_summary_message(self):
counter = self.qs.count()
return npgettext(
- 'Number of matching records in the dashboard '
- 'product attributes list',
+ 'Number of matching records in the dashboard attributes list',
'Found %(counter)d matching attribute',
'Found %(counter)d matching attributes',
number=counter) % {'counter': counter}
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index a8a4fb0b19..149538018b 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -77,7 +77,7 @@ class Query(graphene.ObjectType):
Attribute,
query=graphene.String(description=DESCRIPTIONS['attributes']),
in_category=graphene.Argument(graphene.ID),
- description='List of the shop\'s product attributes.')
+ description='List of the shop\'s attributes.')
categories = DjangoFilterConnectionField(
Category, query=graphene.String(
description=DESCRIPTIONS['category']),
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index 082a7d4e26..18e8bb174f 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -35,10 +35,10 @@ class AttributeCreate(ModelMutation):
class Arguments:
input = AttributesInput(
required=True,
- description='Fields required to create a product attribute.')
+ description='Fields required to create an attribute.')
class Meta:
- description = 'Creates a product attribute.'
+ description = 'Creates an attribute.'
model = models.Attribute
@classmethod
@@ -49,23 +49,23 @@ class AttributeCreate(ModelMutation):
class AttributeUpdate(AttributeCreate):
class Arguments:
id = graphene.ID(
- required=True, description='ID of a product attribute to update.')
+ required=True, description='ID of an attribute to update.')
input = AttributesInput(
required=True,
- description='Fields required to update a product attribute.')
+ description='Fields required to update an attribute.')
class Meta:
- description = 'Updates a product attribute.'
+ description = 'Updates anattribute.'
model = models.Attribute
class AttributeDelete(ModelDeleteMutation):
class Arguments:
id = graphene.ID(
- required=True, description='ID of a product attribute to delete.')
+ required=True, description='ID of an attribute to delete.')
class Meta:
- description = 'Deletes a product attribute.'
+ description = 'Deletes an attribute.'
model = models.Attribute
@classmethod
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py
index 49f034d30b..dbf22c04c2 100644
--- a/saleor/graphql/product/mutations/products.py
+++ b/saleor/graphql/product/mutations/products.py
@@ -199,7 +199,7 @@ class AttributeValueInput(InputObjectType):
class ProductInput(graphene.InputObjectType):
attributes = graphene.List(
AttributeValueInput,
- description='List of product attributes.')
+ description='List of attributes.')
available_on = graphene.types.datetime.Date(
description='Publication date. ISO 8601 standard.')
category = graphene.ID(
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py
index 1a96f24c61..712c86a01c 100644
--- a/saleor/graphql/product/types.py
+++ b/saleor/graphql/product/types.py
@@ -106,7 +106,7 @@ class SelectedAttribute(graphene.ObjectType):
default_value=None, description='Value of an attribute.')
class Meta:
- description = 'Represents a custom product attribute.'
+ description = 'Represents a custom attribute.'
class ProductVariant(CountableDjangoObjectType):
@@ -195,7 +195,7 @@ class Product(CountableDjangoObjectType):
applied).""")
attributes = graphene.List(
SelectedAttribute,
- description='List of product attributes assigned to this product.')
+ description='List of attributes assigned to this product.')
purchase_cost = graphene.Field(MoneyRange)
margin = graphene.Field(Margin)
image_by_id = graphene.Field(
diff --git a/templates/dashboard/product/attribute/detail.html b/templates/dashboard/product/attribute/detail.html
index 54c936047b..135ab80457 100644
--- a/templates/dashboard/product/attribute/detail.html
+++ b/templates/dashboard/product/attribute/detail.html
@@ -84,10 +84,10 @@
</td>
<td class="right-align">
<a href="{% url 'dashboard:attribute-value-update' attribute_pk=attribute.pk value_pk=value.pk %}" class="btn-flat waves-effect">
- {% trans 'Edit' context 'Attribute choice value edit action' %}
+ {% trans 'Edit' context 'Attribute value edit action' %}
</a>
<a class="btn-flat waves-effect modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:attribute-value-delete' attribute_pk=attribute.pk value_pk=value.pk %}">
- {% trans 'Remove' context 'Attribute choice value edit action' %}
+ {% trans 'Remove' context 'Attribute value edit action' %}
</a>
</td>
</tr>
diff --git a/templates/dashboard/product/attribute/values/modal/confirm_delete.html b/templates/dashboard/product/attribute/values/modal/confirm_delete.html
index 12953f9ec5..3f216f6b81 100644
--- a/templates/dashboard/product/attribute/values/modal/confirm_delete.html
+++ b/templates/dashboard/product/attribute/values/modal/confirm_delete.html
@@ -10,14 +10,14 @@
{% block title %}
{% blocktrans trimmed context "Modal delete attribute text" %}
-Delete attribute choice value {{ value }}
+Delete attribute value {{ value }}
{% endblocktrans %}
{% endblock title %}
{% block content %}
<div class="col s12">
{% blocktrans trimmed context "Modal delete attribute text" %}
- Are you sure you want to remove attribute choice value <strong>{{ value }}</strong>?
+ Are you sure you want to remove attribute value <strong>{{ value }}</strong>?
{% endblocktrans %}
</div>
{% endblock content %}
diff --git a/templates/dashboard/shipping/methods/_shipping_methods_table.html b/templates/dashboard/shipping/methods/_shipping_methods_table.html
index 62e2efbb63..daab08401b 100644
--- a/templates/dashboard/shipping/methods/_shipping_methods_table.html
+++ b/templates/dashboard/shipping/methods/_shipping_methods_table.html
@@ -36,10 +36,10 @@
<td>{% price shipping.price %}</td>
<td class="right-align">
<a href="{% url 'dashboard:shipping-method-edit' shipping_zone_pk=shipping_zone.pk shipping_method_pk=shipping.pk %}" class="btn-flat waves-effect">
- {% trans 'Edit' context 'Attribute choice value edit action' %}
+ {% trans 'Edit' context 'Attribute value edit action' %}
</a>
<a class="btn-flat waves-effect modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:shipping-method-delete' shipping_zone_pk=shipping_zone.pk shipping_method_pk=shipping.pk %}">
- {% trans 'Remove' context 'Attribute choice value remove action' %}
+ {% trans 'Remove' context 'Attribute value remove action' %}
</a>
</td>
</tr>