Category : django-templates

can i please get an help in what i’m doing wrong? i have a boolean field in which i want when a user clicks on it, it updates in the database, but i can’t achieve my aim. my code is below for better understanding models.py class OrderItem(models.Model): designer_size = models.ForeignKey("Frame_Sizes_Designer", on_delete=models.CASCADE, blank=True) ***** class Frame_Sizes_Designer(models.Model): ..

Read more

I’m making my portfolio site. Each project is developed with multiple technologies, such as a "website" created with Python, Django and Bootstrap. So I defined my models like this: class Technology(models.Model): name = models.CharField(max_length=50) def __str__(self): return self.name class Meta: verbose_name_plural = ‘Technologies’ class Project(models.Model): name = models.CharField(max_length=200) description = models.TextField() date = models.DateField() technology ..

Read more

My success_url for my class based delete view does not work for some reason. in views.py # allows a user to delete a project class DeletePost(DeleteView): template_name = ‘user_posts/post_delete.html’ model = Post # return to the all posts list success_url = reverse_lazy(‘posts_list’) # make sure the user is looking at its own post def dispatch(self, ..

Read more

I need help on this i have no clue why isnt working. I tried different way and still there is more option left that im aware of —–Here is my HTML code: {% for lajme in lajmet %} <article class="media content-section"> <div class="container"> <div class="container"> <img src="media/{{lajme.fotografit}}"> <h4 style="text-align: center; font-family: Comic Sans; font-weight: 700;"><a ..

Read more

I need help on this i have no clue why isnt working. I tried different way and still there is more option left that im aware of —–Here is my HTML code: {% for lajme in lajmet %} <article class="media content-section"> <div class="container"> <div class="container"> <img src="media/{{lajme.fotografit}}"> <h4 style="text-align: center; font-family: Comic Sans; font-weight: 700;"><a ..

Read more