17 STOCK MANAGEMENT SYSTEM - HOW TO DO FORM VALIDATION IN DJANGO

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 18

  • @ojammeh
    @ojammeh 4 роки тому

    I spend weeks trying to study this but after stumbling over this video, i was able to understand and implement it within minutes. Thank so much Sir.

    • @Arbadjie
      @Arbadjie  4 роки тому

      Glad to hear that.

  • @AsifHowlader4
    @AsifHowlader4 4 роки тому +1

    why we are not using "unique=True" on category type (models file).

    • @Arbadjie
      @Arbadjie  4 роки тому +1

      This is great. Never knew about that. Thanks for sharing

    • @Faceless_News_Channel
      @Faceless_News_Channel 2 роки тому

      Because it will be by default for both add_items/ and list_item/ and we need this uniqueness in list_item/ only. But thanks for this suggestion.

  • @engr.raudahmed4730
    @engr.raudahmed4730 4 роки тому

    here you teach us protect duplicate category enter . but in a stock multiple item in a same category. i think you need different category table and item table . when a item insert that time select from drom down category . i am sure item table need under e category multiple. ex: cat computer -> item dell ,qty:50 ; cat computer ->item accer,qty:10 how can be store in this situation . please solve this. aftter listing join 2 tables catagory and item

    • @akamel3938
      @akamel3938 4 роки тому

      create a model for catgory , then put category as ForeignKey field in item model

  • @pirtondimarurat7937
    @pirtondimarurat7937 3 роки тому

    AttributeError at /add_items/
    type object 'stock' has no attribute 'object' what is solution friend

  • @Opposition916
    @Opposition916 3 роки тому

    I am unable to get the form validation to work like in video 17. I am able to set the model blank = false and this works fine. But when I implement the custom validation the code seems to work fine, the server starts fine but the validation never triggers. Everything gets saved to the database, blank or duplicates, does not matter. I have looked at Django docs, I have searched stackoverflow and nothing seems to fix the issue. I am unsure what is happening. I have followed your tutorial exactly

    • @Arbadjie
      @Arbadjie  3 роки тому +1

      Send your codes to arbcoms.com/community let me look at it

    • @Opposition916
      @Opposition916 3 роки тому

      @@Arbadjie I have posted there, and thank you so much for looking.. here is the post: arbcoms.com/community/computer-inventory/stock-management-video-17-form-validation/#post-89

    • @Arbadjie
      @Arbadjie  3 роки тому

      I just brushed through your code and it seems ok. I will check it again and get back to you.

  • @tanujan3673
    @tanujan3673 4 роки тому

    Tried according to the video but this is not working for the list_items and not for working add_items

    • @Arbadjie
      @Arbadjie  4 роки тому

      Check if it is not overwritten when creating the form in forms.py

    • @tanujan3673
      @tanujan3673 4 роки тому

      @@Arbadjie Got it. Thank you

    • @Opposition916
      @Opposition916 3 роки тому

      @@Arbadjie I think this is what is happening to me, I have the code added like your tutorial says and the server runs fine. However I get no validation errors, the item gets added to the list. What do I need to do to prevent the form from being overwritten?

  • @tilting_cat3344
    @tilting_cat3344 4 роки тому

    hey arbadjie i kept getting indentation error how do i easily fix this?

    • @Arbadjie
      @Arbadjie  4 роки тому

      This is normal and common when copying and pasting codes.
      You gonna select few lines of codes where the error is pointing.
      You will see some lines of code will have periods like this >..... before the code while some will have dashes like this > ----- before the code.
      You will need to have periods of dashes on codes that should have the same indentation.
      You can choose.... Or ----
      Anyone should work.