Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-09 Thread Collin Anderson
Hi, Looking at your traceback, it doesn't look like it's calling your custom save() method. Do your current tracebacks show your custom save method? You could try print(vars(self)) right before saving to see if there is a None that shouldn't be there. Again, if the traceback is happening in

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-06 Thread Danish Ali
No. It also did not work. It was also giving similar error. On Saturday, December 6, 2014, Collin Anderson wrote: > Hi, > > Does this work? (What you've already tried, but not using autoslug at all.) > > from django.utils.text import slugify > > slug =

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-06 Thread Collin Anderson
Hi, Does this work? (What you've already tried, but not using autoslug at all.) from django.utils.text import slugify slug = models.SlugField(null=True, blank=True) def save(self, *args, **kwargs): self.slug = slugify(self.name or '') super(Shop, self).save(*args,

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-05 Thread Danish Ali
If I remove slug code, then everything works fine. And can you tell me how can I expand the variables? Thanks On Fri, Dec 5, 2014 at 6:51 PM, Collin Anderson wrote: > Hi, > > If you remove all the slug code do you still get this error? If so, then > the error has nothing

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-05 Thread Collin Anderson
Hi, If you remove all the slug code do you still get this error? If so, then the error has nothing to do with automatically creating a slug. Try expanding Local vars to see what "params" and "sql are. File "e:\python\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 920.

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Danish Ali
so is there anyway to create slug automatically other than this ? On Thu, Dec 4, 2014 at 1:29 AM, donarb wrote: > On Wednesday, December 3, 2014 11:59:42 AM UTC-8, Danish Ali wrote: >> >> this is stacktrace when I use: slug = AutoSlugField(populate_from='name') >> in my model

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread donarb
On Wednesday, December 3, 2014 11:59:42 AM UTC-8, Danish Ali wrote: > > this is stacktrace when I use: slug = AutoSlugField(populate_from='name') > in my model > > > Environment: > > > Request Method: POST > Request URL: http://127.0.0.1:8000/admin/product/shop/add/ > > Django Version: 1.7.1 >

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Danish Ali
this is stacktrace when I use: slug = AutoSlugField(populate_from='name') in my model Environment: Request Method: POST Request URL: http://127.0.0.1:8000/admin/product/shop/add/ Django Version: 1.7.1 Python Version: 3.4.2 Installed Applications: ('django.contrib.admin',

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Babatunde Akinyanmi
At this point i think it will be good to paste the stacktrace here On 3 Dec 2014 14:18, "Danish Ali" wrote: > I also used this method. But I got same error in this method too. > > def save(self, *args, **kwargs): > self.slug = slugify(self.name) > super(Shop,

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Danish Ali
I also used this method. But I got same error in this method too. def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Shop, self).save(*args, **kwargs) Please let me know if this is correct or not. -- You received this message because you are subscribed to the Google

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-02 Thread Mike Dewhirst
On 3/12/2014 1:58 AM, Danish Ali wrote: can someone help please ? I haven't been watching this thread but I just solved a similar problem with 'NoneType is not iterable' My problem was fixed when I ensured the functions involved got passed a type they were expecting. I'm guessing you

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-02 Thread Danish Ali
can someone help please ? On Monday, December 1, 2014 6:35:56 PM UTC+5, Danish Ali wrote: > > I am not sure about that. > is there any other easy way to get autofill slug then :) > > > On Monday, December 1, 2014 6:34:05 PM UTC+5, Jani Tiainen wrote: >> >> On Mon, 1 Dec 2014 10:20:24 -0300 >>

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Danish Ali
I am not sure about that. is there any other easy way to get autofill slug then :) On Monday, December 1, 2014 6:34:05 PM UTC+5, Jani Tiainen wrote: > > On Mon, 1 Dec 2014 10:20:24 -0300 > Vijay Khemlani wrote: > > > Have you tried following the stacktrace that resulted

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Jani Tiainen
On Mon, 1 Dec 2014 10:20:24 -0300 Vijay Khemlani wrote: > Have you tried following the stacktrace that resulted in the error? > > Does it fail when trying to strip the contents of the "name" field? > Or maybe that library where field AutoSlug comes from isn't compatible

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Danish Ali
ds: >> http://127.0.0.1:8000/admin/product/shop/add/ >> >> >> On Monday, December 1, 2014 6:15:08 PM UTC+5, Jani Tiainen wrote: >>> >>> On Mon, 1 Dec 2014 04:12:45 -0800 (PST) >>> Danish Ali <dan...@jotixtech.com> wrote: >>> &g

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Kelvin Wong
UTC-8, Danish Ali wrote: >>> >>> Hello, >>> >>> I am getting this error: Error: 'NoneType' object has no attribute >>> 'strip' >>> I have created a model and I am trying to autofill slug field in it. >>> When I save the record in database

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Vijay Khemlani
t; Hello, >> > >> > I am getting this error: Error: 'NoneType' object has no attribute >> 'strip' >> > I have created a model and I am trying to autofill slug field in it. >> When I >> > save the record in database I get this error: Error: 'NoneType' object

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Danish Ali
.com > wrote: > > > Hello, > > > > I am getting this error: Error: 'NoneType' object has no attribute > 'strip' > > I have created a model and I am trying to autofill slug field in it. > When I > > save the record in database I get this error: Er

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Jani Tiainen
On Mon, 1 Dec 2014 04:12:45 -0800 (PST) Danish Ali <dan...@jotixtech.com> wrote: > Hello, > > I am getting this error: Error: 'NoneType' object has no attribute 'strip' > I have created a model and I am trying to autofill slug field in it. When I > save the record in data

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Danish Ali
; >> Hello, >> >> I am getting this error: Error: 'NoneType' object has no attribute 'strip' >> I have created a model and I am trying to autofill slug field in it. When >> I save the record in database I get this error: Error: 'NoneType' object >> has no attri

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Kelvin Wong
Comment out the earlier slug field. What happens? # slug = models.SlugField(null=True, blank=True) K On Monday, December 1, 2014 4:12:45 AM UTC-8, Danish Ali wrote: > > Hello, > > I am getting this error: Error: 'NoneType' object has no attribute 'strip' > I have created a model

Error: 'NoneType' object has no attribute 'strip'

2014-12-01 Thread Danish Ali
Hello, I am getting this error: Error: 'NoneType' object has no attribute 'strip' I have created a model and I am trying to autofill slug field in it. When I save the record in database I get this error: Error: 'NoneType' object has no attribute 'strip' My model is: from django.db import