Klurifixus / butikado

före projectet
0 stars 2 forks source link

Fix Add_products.html and add function for produc sizes #17

Open Klurifixus opened 10 months ago

Klurifixus commented 10 months ago
Skärmbild 2024-01-19 110644

Description: We are aiming to revamp our product management system to better meet the needs of our users and align with our inventory strategies. This issue involves removing certain features and adding new functionalities related to product sizes.

User Stories: As a product manager, I want to remove the ability to delete products from our system, so that we maintain a historical record of all items ever listed.

Acceptance Criteria: The 'Delete' option should be removed add_product.html.

Acceptance Criteria: As a store administrator, I need to add multiple size options for a single product, to provide our customers with a range of size selections for our products.

Acceptance Criteria: Implement a feature to add different sizes for each product. Ensure the interface for adding sizes is intuitive and fits seamlessly with the existing product management system. The system should support an adjustable number of sizes for each product.

Klurifixus commented 10 months ago

added this to forms.py: for size_form in self.size_formset: for field_name, field in size_form.fields.items(): if field_name in ["id", "DELETE", "product"]: field.widget.attrs['class'] = 'd-none' and this to add_product.html:

{{ form.size_formset.management_form }} {% for size_form in form.size_formset %}
{% for field in size_form %} {% if should_hide_field %}
{{ field }}
{% else %} {{ field.label_tag }} {{ field }} {% endif %} {% endfor %}
{% endfor %}

yet dosnt work... seems to be problem with overwriting django fields