Sorry, the save method isn’t supposed to be inside the _get_unique_slug()
function. That’s what happens when u type code on an iPad.
On Sat, Mar 20, 2021 at 14:08 Kelvin Sajere wrote:
> Just adding to the previous answer, you should always make sure your slug
> field is unique when saving,
Just adding to the previous answer, you should always make sure your slug
field is unique when saving, as sometimes two posts can have the same title
and that would result to an error.
def _get_unique_slug(self): slug = slugify(self.blog_title)
unique_slug = slug
num = 1
while Blog.objects.filte
Thank you so much for helping me with this
On Sat, 20 Mar, 2021 at 7:22 PM, Omkar Parab wrote:
> First, import slugify 👇
>
> from django.template.defaultfilters import slugify
>
> then,
>
> Add this 👇 below the "def __str__()" in your Blog model.
>
> def save(self, *args, **kwargs):
> if
First, import slugify 👇
from django.template.defaultfilters import slugify
then,
Add this 👇 below the "def __str__()" in your Blog model.
def save(self, *args, **kwargs):
if not self.slug:
self.slug = slugify(self.blog_title)
return super().save(*args, **kwargs)
On
On 20/03/2021 12.10, Noyon Barman wrote:
> Please help me what should I do now
>
You should learn how to write a proper question. Just posting
screenshots of error messages and not even doing the minimal effort
required to solve the problem yourself or take the time to describe your
problem is ext
Your slug is adding extra characters after the main title.
On Sat, Mar 20, 2021, 5:31 PM Omkar Parab wrote:
> Looks like, the slug is not configured correctly. Post the screen-shot of
> the models.py file of the "App_blog" App.
>
> On Sat, Mar 20, 2021, 4:48 PM Noyon Barman
> wrote:
>
>> Please
Looks like, the slug is not configured correctly. Post the screen-shot of
the models.py file of the "App_blog" App.
On Sat, Mar 20, 2021, 4:48 PM Noyon Barman
wrote:
> Please help me what should I do now
>
> On Sat, Mar 20, 2021 at 12:39 PM Omkar Parab
> wrote:
>
>> Post the screen-shot of app/
Post the screen-shot of app/urls.py file.
On Sat, Mar 20, 2021, 4:05 AM Noyon Barman
wrote:
>
>
> On Sat, Mar 20, 2021 at 4:00 AM Anornymous u
> wrote:
>
>> Send the error displayed on the browser in red
>>
>> On Sat, Mar 20, 2021, 00:54 Noyon Barman
>> wrote:
>>
>>>
>>>
>>> On Sat, Mar 20, 20
Bro, I mean send me the error displayed on the browser in red, that will
help a little bit.
On Sat, Mar 20, 2021, 01:36 Noyon Barman wrote:
>
>
> On Sat, Mar 20, 2021 at 4:00 AM Anornymous u
> wrote:
>
>> Send the error displayed on the browser in red
>>
>> On Sat, Mar 20, 2021, 00:54 Noyon Bar
On Sat, Mar 20, 2021 at 4:00 AM Anornymous u wrote:
> Send the error displayed on the browser in red
>
> On Sat, Mar 20, 2021, 00:54 Noyon Barman
> wrote:
>
>>
>>
>> On Sat, Mar 20, 2021 at 3:31 AM Noyon Barman
>> wrote:
>>
>>>
>>>
>>> On Sat, Mar 20, 2021 at 3:26 AM Héctor Alonso Lozada Echezu
Send the error displayed on the browser in red
On Sat, Mar 20, 2021, 00:54 Noyon Barman wrote:
>
>
> On Sat, Mar 20, 2021 at 3:31 AM Noyon Barman
> wrote:
>
>>
>>
>> On Sat, Mar 20, 2021 at 3:26 AM Héctor Alonso Lozada Echezuría <
>> ima...@gmail.com> wrote:
>>
>>> Exactly
>>>
>>> El vie, 19 ma
Delete the keyword argument commit=False
On Sat, Mar 20, 2021, 00:39 Noyon Barman wrote:
>
>
> On Sat, Mar 20, 2021 at 3:26 AM Héctor Alonso Lozada Echezuría <
> ima...@gmail.com> wrote:
>
>> Exactly
>>
>> El vie, 19 mar 2021 a las 15:25, Anornymous u ()
>> escribió:
>>
>>> Line 17 not 14
>>>
>>
Exactly
El vie, 19 mar 2021 a las 15:25, Anornymous u ()
escribió:
> Line 17 not 14
>
> On Sat, Mar 20, 2021, 00:22 Héctor Alonso Lozada Echezuría <
> ima...@gmail.com> wrote:
>
>> Line 14: fields not feilds
>>
>> El vie, 19 mar 2021 a las 15:17, Noyon Barman ()
>> escribió:
>>
>>> What happens h
Line 17 not 14
On Sat, Mar 20, 2021, 00:22 Héctor Alonso Lozada Echezuría
wrote:
> Line 14: fields not feilds
>
> El vie, 19 mar 2021 a las 15:17, Noyon Barman ()
> escribió:
>
>> What happens here? How do I solve this problem?
>>
>> --
>> You received this message because you are subscribed to
Share source for blog model
On Sat, Mar 20, 2021, 00:17 Noyon Barman wrote:
> What happens here? How do I solve this problem?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from
Line 14: fields not feilds
El vie, 19 mar 2021 a las 15:17, Noyon Barman ()
escribió:
> What happens here? How do I solve this problem?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving em
16 matches
Mail list logo