Crud operations for models with relationships from the django Rest Framework in vue js cdn

Submitted 3 years, 8 months ago
Ticket #107
Views 265
Language/Framework Django
Priority Urgent
Status Closed

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

Submitted on Aug 15, 20
add a comment

2 Answers

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

Submitted 3 years, 8 months ago

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 3 years, 8 months ago

if 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.

- Vengat 3 years, 8 months ago

Hello  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

Submitted 3 years, 8 months ago

Use coding format when you upload the code or share github link.

- Vengat 3 years, 8 months ago

As we didnt get any update on this. we are closing this ticket.

- Vengat 3 years, 8 months ago


Latest Blogs