Re: Comment Form Related issue

2019-04-26 Thread Robin Riis
its pretty much the same, you can check on class based view where you have CreateView and UpdateView and so on and i would recomend to add the following to models.py: updated_at = models.DateTimeField(null=True) updated_by = models.ForeignKey(get_user_model(), on_delete=models.CASCADE, null=True)

Re: Comment Form Related issue

2019-04-26 Thread Soumen Khatua
Okay,Could you tell me If any user want to update their comment it later the process is same or different? Thank You On Fri, Apr 26, 2019 at 5:31 PM Robin Riis wrote: > class Comment(models.Model): <--- in models.py > > class CommentForm(forms.ModelForm): <--- in forms.py > > def CommentVideo(

Re: Comment Form Related issue

2019-04-26 Thread Robin Riis
class Comment(models.Model): <--- in models.py class CommentForm(forms.ModelForm): <--- in forms.py def CommentVideo(request, pk): <--- in views.py and the video is another model i used since you said like youtube. :) Den fre 26 apr. 2019 kl 13:33 skrev Soumen Khatua : > yes,I'm new to django

Re: Comment Form Related issue

2019-04-26 Thread Soumen Khatua
yes,I'm new to django so let me check once. Thank You for your response. On Fri, Apr 26, 2019 at 4:36 PM Robin Riis wrote: > class Comment(models.Model): > > message = models.TextField() > > video = models.ForeignKey(Video, related_name='comments', > on_delete=models.CASCADE) > > created_at = mo

Re: Comment Form Related issue

2019-04-26 Thread Robin Riis
class Comment(models.Model): message = models.TextField() video = models.ForeignKey(Video, related_name='comments', on_delete=models.CASCADE) created_at = models.DateTimeField(auto_now_add=True) created_by = models.ForeignKey(get_user_model(), related_name='comments', on_delete=models.CASCADE)

Comment Form Related issue

2019-04-26 Thread Soumen Khatua
Hi Folks, I want to show one textarea where only logged in users can comment otherwise if they are click the textareabox redirect them to login page just like youutbe comnet box. If anyone have any source code related to this please share. Thank You. Regards, Soumen -- You received this messag