How do i work on post, put, get , delete and patch methods on models with relationships from the django restframework in vue js using cdn not cli?
Forexample models like:
Creating a new user profile model. etc
Regards
Perez
Ok thank you But i needed a scenario where you are dealing with relationships, a more complex modal structure not a single table... I am more interested in the vue logic for the crud operations on nested objects from the api. Thank you for the help Regards
- perez 4 years, 8 months agoif you would like to work on more complex model structure then you just need to provide your basic skeleton and more details about your requirement. Based on that we will extend accordingly. Without knowing anything Its very hard to explain you. So, lets prepare your model skeleton first , we can move forward from there. The Blog which i shared is well enough to proceed further.
- VengatHello These are the models am working with 1: Department Model class Department(models.Model): code = models.CharField(max_length=200, null=True, blank=True) name = models.CharField(max_length=200, null=True, blank=True) description = models.CharField(max_length=200, null=True, blank=True) def __str__(self): return self.name 2: Staff Model class Staff(models.Model): code = models.CharField(max_length=200, null=True, blank=True) user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) department = models.ForeignKey(Department, on_delete=models.SET_NULL, null=True, blank=True) phone = models.CharField(max_length=200, null=True, blank=True) address = models.CharField(max_length=200, null=True, blank=True) nin = models.CharField(max_length=200, null=True, blank=True) password = models.CharField(max_length=200, null=True, blank=True) gender = models.CharField(max_length=200, null=True, blank=True) def __str__(self): return self.user.username I need help to do crud operations for the staff model from vuejs from rest framework api Thank you Regards Perez
As this new requirement question, I would request not to choose URGENT/HIGH in future.
Regarding your request, please check this post it would help you to understand Django Vue Js CDN integration.