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 the browser, see if you can figure 
out what's in the "params" dict by clicking "local vars".

Collin

On Saturday, December 6, 2014 2:07:00 PM UTC-5, Danish Ali wrote:
>
> 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 = models.SlugField(null=True, blank=True)
>> def save(self, *args, **kwargs):
>> self.slug = slugify(self.name or '')
>> super(Shop, self).save(*args, **kwargs)
>>
>> If you have a "pretty" django traceback, you can click to expand where it 
>> says "▶ Local vars".
>>
>> Collin
>>
>>
>> On Friday, December 5, 2014 8:55:06 AM UTC-5, Danish Ali wrote:
>>>
>>> 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 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. cursor.execute(sql, params)
 File "e:\python\lib\site-packages\django\db\backends\utils.py" in 
 execute
   85. sql = self.db.ops.last_executed_query(self.cursor, 
 sql, params)

 This does seem like a bug in mysql-connector. You may want to bring it 
 up on the mysql-connector list. http://forums.mysql.com/list.php?50

 You could also try using mysqlclient instead to see if you still have 
 the problem. That's django's recommended connector.
 https://pypi.python.org/pypi/mysqlclient
 https://docs.djangoproject.com/en/dev/ref/databases/#
 mysql-db-api-drivers

 Collin

 On Wednesday, December 3, 2014 3:33:48 PM UTC-5, Danish Ali wrote:
>
> 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 
>>>
>>>
>>> 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',
>>>  'django.contrib.auth',
>>>  'django.contrib.contenttypes',
>>>  'django.contrib.sessions',
>>>  'django.contrib.messages',
>>>  'django.contrib.staticfiles',
>>>  'product')
>>> Installed Middleware:
>>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>>  'django.middleware.common.CommonMiddleware',
>>>  'django.middleware.csrf.CsrfViewMiddleware',
>>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>>  'django.contrib.messages.middleware.MessageMiddleware',
>>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>>
>>>
>>> Traceback:
>>> File "e:\python\lib\site-packages\django\core\handlers\base.py" in 
>>> get_response
>>>   111. response = wrapped_callback(request, 
>>> *callback_args, **callback_kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" 
>>> in wrapper
>>>   584. return self.admin_site.admin_view(view)(*args, 
>>> **kwargs)
>>> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
>>> _wrapped_view
>>>   105. response = view_func(request, *args, 
>>> **kwargs)
>>> File "e:\python\lib\site-packages\django\views\decorators\cache.py" 
>>> in _wrapped_view_func
>>>   52. response = view_func(request, *args, **kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in 
>>> inner
>>>   204. return view(request, *args, **kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" 
>>> in add_view
>>>   1454. return self.changeform_view(request, None, form_url, 
>>> extra_context)
>>> File "e:\python\lib\site-packages\django\utils\decorators.py" 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 = models.SlugField(null=True, blank=True)
> def save(self, *args, **kwargs):
> self.slug = slugify(self.name or '')
> super(Shop, self).save(*args, **kwargs)
>
> If you have a "pretty" django traceback, you can click to expand where it
> says "▶ Local vars".
>
> Collin
>
>
> On Friday, December 5, 2014 8:55:06 AM UTC-5, Danish Ali wrote:
>>
>> 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 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. cursor.execute(sql, params)
>>> File "e:\python\lib\site-packages\django\db\backends\utils.py" in
>>> execute
>>>   85. sql = self.db.ops.last_executed_query(self.cursor, sql
>>> , params)
>>>
>>> This does seem like a bug in mysql-connector. You may want to bring it
>>> up on the mysql-connector list. http://forums.mysql.com/list.php?50
>>>
>>> You could also try using mysqlclient instead to see if you still have
>>> the problem. That's django's recommended connector.
>>> https://pypi.python.org/pypi/mysqlclient
>>> https://docs.djangoproject.com/en/dev/ref/databases/#
>>> mysql-db-api-drivers
>>>
>>> Collin
>>>
>>> On Wednesday, December 3, 2014 3:33:48 PM UTC-5, Danish Ali wrote:

 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
>>
>>
>> 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',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'product')
>> Installed Middleware:
>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>
>>
>> Traceback:
>> File "e:\python\lib\site-packages\django\core\handlers\base.py" in
>> get_response
>>   111. response = wrapped_callback(request,
>> *callback_args, **callback_kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\options.py"
>> in wrapper
>>   584. return self.admin_site.admin_view(view)(*args,
>> **kwargs)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> _wrapped_view
>>   105. response = view_func(request, *args,
>> **kwargs)
>> File "e:\python\lib\site-packages\django\views\decorators\cache.py"
>> in _wrapped_view_func
>>   52. response = view_func(request, *args, **kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in
>> inner
>>   204. return view(request, *args, **kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\options.py"
>> in add_view
>>   1454. return self.changeform_view(request, None, form_url,
>> extra_context)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> _wrapper
>>   29. return bound_func(*args, **kwargs)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> _wrapped_view
>>   105. response = view_func(request, *args,
>> **kwargs)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> bound_func
>>   25. return func.__get__(self, type(self))(*args2,
>> **kwargs2)
>> File "e:\python\lib\site-packages\django\db\transaction.py" in inner
>>   394. return func(*args, **kwargs)
>> File 

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, **kwargs)

If you have a "pretty" django traceback, you can click to expand where it 
says "▶ Local vars".

Collin


On Friday, December 5, 2014 8:55:06 AM UTC-5, Danish Ali wrote:
>
> 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 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. cursor.execute(sql, params)
>> File "e:\python\lib\site-packages\django\db\backends\utils.py" in execute
>>   85. sql = self.db.ops.last_executed_query(self.cursor, sql, 
>> params)
>>
>> This does seem like a bug in mysql-connector. You may want to bring it up 
>> on the mysql-connector list. http://forums.mysql.com/list.php?50
>>
>> You could also try using mysqlclient instead to see if you still have the 
>> problem. That's django's recommended connector.
>> https://pypi.python.org/pypi/mysqlclient
>> https://docs.djangoproject.com/en/dev/ref/databases/#mysql-db-api-drivers
>>
>> Collin
>>
>> On Wednesday, December 3, 2014 3:33:48 PM UTC-5, Danish Ali wrote:
>>>
>>> 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 
>
>
> 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',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'product')
> Installed Middleware:
> ('django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>
>
> Traceback:
> File "e:\python\lib\site-packages\django\core\handlers\base.py" in 
> get_response
>   111. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> wrapper
>   584. return self.admin_site.admin_view(view)(*args, 
> **kwargs)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
> _wrapped_view
>   105. response = view_func(request, *args, 
> **kwargs)
> File "e:\python\lib\site-packages\django\views\decorators\cache.py" 
> in _wrapped_view_func
>   52. response = view_func(request, *args, **kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in 
> inner
>   204. return view(request, *args, **kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> add_view
>   1454. return self.changeform_view(request, None, form_url, 
> extra_context)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
> _wrapper
>   29. return bound_func(*args, **kwargs)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
> _wrapped_view
>   105. response = view_func(request, *args, 
> **kwargs)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
> bound_func
>   25. return func.__get__(self, type(self))(*args2, 
> **kwargs2)
> File "e:\python\lib\site-packages\django\db\transaction.py" in inner
>   394. return func(*args, **kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> changeform_view
>   1405. self.save_model(request, new_object, form, not 
> add)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> save_model
>   1046. 

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 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. cursor.execute(sql, params)
> File "e:\python\lib\site-packages\django\db\backends\utils.py" in execute
>   85. sql = self.db.ops.last_executed_query(self.cursor, sql,
> params)
>
> This does seem like a bug in mysql-connector. You may want to bring it up
> on the mysql-connector list. http://forums.mysql.com/list.php?50
>
> You could also try using mysqlclient instead to see if you still have the
> problem. That's django's recommended connector.
> https://pypi.python.org/pypi/mysqlclient
> https://docs.djangoproject.com/en/dev/ref/databases/#mysql-db-api-drivers
>
> Collin
>
> On Wednesday, December 3, 2014 3:33:48 PM UTC-5, Danish Ali wrote:
>>
>> 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


 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',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  'product')
 Installed Middleware:
 ('django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware')


 Traceback:
 File "e:\python\lib\site-packages\django\core\handlers\base.py" in
 get_response
   111. response = wrapped_callback(request,
 *callback_args, **callback_kwargs)
 File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
 wrapper
   584. return self.admin_site.admin_view(view)(*args,
 **kwargs)
 File "e:\python\lib\site-packages\django\utils\decorators.py" in
 _wrapped_view
   105. response = view_func(request, *args,
 **kwargs)
 File "e:\python\lib\site-packages\django\views\decorators\cache.py" in
 _wrapped_view_func
   52. response = view_func(request, *args, **kwargs)
 File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in
 inner
   204. return view(request, *args, **kwargs)
 File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
 add_view
   1454. return self.changeform_view(request, None, form_url,
 extra_context)
 File "e:\python\lib\site-packages\django\utils\decorators.py" in
 _wrapper
   29. return bound_func(*args, **kwargs)
 File "e:\python\lib\site-packages\django\utils\decorators.py" in
 _wrapped_view
   105. response = view_func(request, *args,
 **kwargs)
 File "e:\python\lib\site-packages\django\utils\decorators.py" in
 bound_func
   25. return func.__get__(self, type(self))(*args2,
 **kwargs2)
 File "e:\python\lib\site-packages\django\db\transaction.py" in inner
   394. return func(*args, **kwargs)
 File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
 changeform_view
   1405. self.save_model(request, new_object, form, not
 add)
 File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
 save_model
   1046. obj.save()
 File "e:\python\lib\site-packages\django\db\models\base.py" in save
   591.force_update=force_update,
 update_fields=update_fields)
 File "e:\python\lib\site-packages\django\db\models\base.py" in
 save_base
   619. updated = self._save_table(raw, cls, force_insert,
 force_update, using, update_fields)
 File "e:\python\lib\site-packages\django\db\models\base.py" in
 _save_table
   700. result = self._do_insert(cls._base_manager, using,
 fields, update_pk, raw)
 File 

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. cursor.execute(sql, params)
File "e:\python\lib\site-packages\django\db\backends\utils.py" in execute
  85. sql = self.db.ops.last_executed_query(self.cursor, sql, 
params)

This does seem like a bug in mysql-connector. You may want to bring it up 
on the mysql-connector list. http://forums.mysql.com/list.php?50

You could also try using mysqlclient instead to see if you still have the 
problem. That's django's recommended connector.
https://pypi.python.org/pypi/mysqlclient
https://docs.djangoproject.com/en/dev/ref/databases/#mysql-db-api-drivers

Collin

On Wednesday, December 3, 2014 3:33:48 PM UTC-5, Danish Ali wrote:
>
> 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 
>>>
>>>
>>> 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',
>>>  'django.contrib.auth',
>>>  'django.contrib.contenttypes',
>>>  'django.contrib.sessions',
>>>  'django.contrib.messages',
>>>  'django.contrib.staticfiles',
>>>  'product')
>>> Installed Middleware:
>>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>>  'django.middleware.common.CommonMiddleware',
>>>  'django.middleware.csrf.CsrfViewMiddleware',
>>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>>  'django.contrib.messages.middleware.MessageMiddleware',
>>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>>
>>>
>>> Traceback:
>>> File "e:\python\lib\site-packages\django\core\handlers\base.py" in 
>>> get_response
>>>   111. response = wrapped_callback(request, 
>>> *callback_args, **callback_kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
>>> wrapper
>>>   584. return self.admin_site.admin_view(view)(*args, 
>>> **kwargs)
>>> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
>>> _wrapped_view
>>>   105. response = view_func(request, *args, **kwargs)
>>> File "e:\python\lib\site-packages\django\views\decorators\cache.py" in 
>>> _wrapped_view_func
>>>   52. response = view_func(request, *args, **kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in 
>>> inner
>>>   204. return view(request, *args, **kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
>>> add_view
>>>   1454. return self.changeform_view(request, None, form_url, 
>>> extra_context)
>>> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
>>> _wrapper
>>>   29. return bound_func(*args, **kwargs)
>>> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
>>> _wrapped_view
>>>   105. response = view_func(request, *args, **kwargs)
>>> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
>>> bound_func
>>>   25. return func.__get__(self, type(self))(*args2, 
>>> **kwargs2)
>>> File "e:\python\lib\site-packages\django\db\transaction.py" in inner
>>>   394. return func(*args, **kwargs)
>>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
>>> changeform_view
>>>   1405. self.save_model(request, new_object, form, not 
>>> add)
>>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
>>> save_model
>>>   1046. obj.save()
>>> File "e:\python\lib\site-packages\django\db\models\base.py" in save
>>>   591.force_update=force_update, 
>>> update_fields=update_fields)
>>> File "e:\python\lib\site-packages\django\db\models\base.py" in save_base
>>>   619. updated = self._save_table(raw, cls, force_insert, 
>>> force_update, using, update_fields)
>>> File "e:\python\lib\site-packages\django\db\models\base.py" in 
>>> _save_table
>>>   700. result = self._do_insert(cls._base_manager, using, 
>>> fields, update_pk, raw)
>>> File "e:\python\lib\site-packages\django\db\models\base.py" in 
>>> _do_insert
>>>   733.using=using, raw=raw)
>>> File "e:\python\lib\site-packages\django\db\models\manager.py" in 
>>> manager_method
>>>   92. return getattr(self.get_queryset(), name)(*args, 
>>> **kwargs)
>>> File 

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
>>
>>
>> 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',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'product')
>> Installed Middleware:
>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>
>>
>> Traceback:
>> File "e:\python\lib\site-packages\django\core\handlers\base.py" in
>> get_response
>>   111. response = wrapped_callback(request,
>> *callback_args, **callback_kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
>> wrapper
>>   584. return self.admin_site.admin_view(view)(*args,
>> **kwargs)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> _wrapped_view
>>   105. response = view_func(request, *args, **kwargs)
>> File "e:\python\lib\site-packages\django\views\decorators\cache.py" in
>> _wrapped_view_func
>>   52. response = view_func(request, *args, **kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in inner
>>   204. return view(request, *args, **kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
>> add_view
>>   1454. return self.changeform_view(request, None, form_url,
>> extra_context)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in _wrapper
>>   29. return bound_func(*args, **kwargs)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> _wrapped_view
>>   105. response = view_func(request, *args, **kwargs)
>> File "e:\python\lib\site-packages\django\utils\decorators.py" in
>> bound_func
>>   25. return func.__get__(self, type(self))(*args2,
>> **kwargs2)
>> File "e:\python\lib\site-packages\django\db\transaction.py" in inner
>>   394. return func(*args, **kwargs)
>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
>> changeform_view
>>   1405. self.save_model(request, new_object, form, not
>> add)
>> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
>> save_model
>>   1046. obj.save()
>> File "e:\python\lib\site-packages\django\db\models\base.py" in save
>>   591.force_update=force_update,
>> update_fields=update_fields)
>> File "e:\python\lib\site-packages\django\db\models\base.py" in save_base
>>   619. updated = self._save_table(raw, cls, force_insert,
>> force_update, using, update_fields)
>> File "e:\python\lib\site-packages\django\db\models\base.py" in
>> _save_table
>>   700. result = self._do_insert(cls._base_manager, using,
>> fields, update_pk, raw)
>> File "e:\python\lib\site-packages\django\db\models\base.py" in _do_insert
>>   733.using=using, raw=raw)
>> File "e:\python\lib\site-packages\django\db\models\manager.py" in
>> manager_method
>>   92. return getattr(self.get_queryset(), name)(*args,
>> **kwargs)
>> File "e:\python\lib\site-packages\django\db\models\query.py" in _insert
>>   921. return query.get_compiler(using=
>> using).execute_sql(return_id)
>> File "e:\python\lib\site-packages\django\db\models\sql\compiler.py" in
>> execute_sql
>>   920. cursor.execute(sql, params)
>> File "e:\python\lib\site-packages\django\db\backends\utils.py" in execute
>>   85. sql = self.db.ops.last_executed_query(self.cursor,
>> sql, params)
>> File "e:\python\lib\site-packages\mysql\connector\django\base.py" in
>> last_executed_query
>>   371. return cursor.statement
>> File "e:\python\lib\site-packages\mysql\connector\django\base.py" in
>> __getattr__
>>   147. return getattr(self.cursor, attr)
>> File "e:\python\lib\site-packages\mysql\connector\cursor.py" in statement
>>   858. return self._executed.strip()
>>
>> Exception Type: AttributeError at /admin/product/shop/add/
>> Exception Value: 'NoneType' object has no attribute 'strip'
>>
>>
> Looks like a bug in MySQL/connector (although it could just be a symptom
> of doing the same thing in Django as the 

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
> Python Version: 3.4.2
> Installed Applications:
> ('django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'product')
> Installed Middleware:
> ('django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>
>
> Traceback:
> File "e:\python\lib\site-packages\django\core\handlers\base.py" in 
> get_response
>   111. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> wrapper
>   584. return self.admin_site.admin_view(view)(*args, 
> **kwargs)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
> _wrapped_view
>   105. response = view_func(request, *args, **kwargs)
> File "e:\python\lib\site-packages\django\views\decorators\cache.py" in 
> _wrapped_view_func
>   52. response = view_func(request, *args, **kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in inner
>   204. return view(request, *args, **kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> add_view
>   1454. return self.changeform_view(request, None, form_url, 
> extra_context)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in _wrapper
>   29. return bound_func(*args, **kwargs)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in 
> _wrapped_view
>   105. response = view_func(request, *args, **kwargs)
> File "e:\python\lib\site-packages\django\utils\decorators.py" in bound_func
>   25. return func.__get__(self, type(self))(*args2, 
> **kwargs2)
> File "e:\python\lib\site-packages\django\db\transaction.py" in inner
>   394. return func(*args, **kwargs)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> changeform_view
>   1405. self.save_model(request, new_object, form, not add)
> File "e:\python\lib\site-packages\django\contrib\admin\options.py" in 
> save_model
>   1046. obj.save()
> File "e:\python\lib\site-packages\django\db\models\base.py" in save
>   591.force_update=force_update, 
> update_fields=update_fields)
> File "e:\python\lib\site-packages\django\db\models\base.py" in save_base
>   619. updated = self._save_table(raw, cls, force_insert, 
> force_update, using, update_fields)
> File "e:\python\lib\site-packages\django\db\models\base.py" in _save_table
>   700. result = self._do_insert(cls._base_manager, using, 
> fields, update_pk, raw)
> File "e:\python\lib\site-packages\django\db\models\base.py" in _do_insert
>   733.using=using, raw=raw)
> File "e:\python\lib\site-packages\django\db\models\manager.py" in 
> manager_method
>   92. return getattr(self.get_queryset(), name)(*args, 
> **kwargs)
> File "e:\python\lib\site-packages\django\db\models\query.py" in _insert
>   921. return 
> query.get_compiler(using=using).execute_sql(return_id)
> File "e:\python\lib\site-packages\django\db\models\sql\compiler.py" in 
> execute_sql
>   920. cursor.execute(sql, params)
> File "e:\python\lib\site-packages\django\db\backends\utils.py" in execute
>   85. sql = self.db.ops.last_executed_query(self.cursor, sql, 
> params)
> File "e:\python\lib\site-packages\mysql\connector\django\base.py" in 
> last_executed_query
>   371. return cursor.statement
> File "e:\python\lib\site-packages\mysql\connector\django\base.py" in 
> __getattr__
>   147. return getattr(self.cursor, attr)
> File "e:\python\lib\site-packages\mysql\connector\cursor.py" in statement
>   858. return self._executed.strip()
>
> Exception Type: AttributeError at /admin/product/shop/add/
> Exception Value: 'NoneType' object has no attribute 'strip'
>
>
Looks like a bug in MySQL/connector (although it could just be a symptom of 
doing the same thing in Django as the bug poster):

https://bugs.mysql.com/bug.php?id=74675


-- 
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 it, send an 

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',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'product')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Traceback:
File "e:\python\lib\site-packages\django\core\handlers\base.py" in
get_response
  111. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
wrapper
  584. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "e:\python\lib\site-packages\django\utils\decorators.py" in
_wrapped_view
  105. response = view_func(request, *args, **kwargs)
File "e:\python\lib\site-packages\django\views\decorators\cache.py" in
_wrapped_view_func
  52. response = view_func(request, *args, **kwargs)
File "e:\python\lib\site-packages\django\contrib\admin\sites.py" in inner
  204. return view(request, *args, **kwargs)
File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
add_view
  1454. return self.changeform_view(request, None, form_url,
extra_context)
File "e:\python\lib\site-packages\django\utils\decorators.py" in _wrapper
  29. return bound_func(*args, **kwargs)
File "e:\python\lib\site-packages\django\utils\decorators.py" in
_wrapped_view
  105. response = view_func(request, *args, **kwargs)
File "e:\python\lib\site-packages\django\utils\decorators.py" in bound_func
  25. return func.__get__(self, type(self))(*args2,
**kwargs2)
File "e:\python\lib\site-packages\django\db\transaction.py" in inner
  394. return func(*args, **kwargs)
File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
changeform_view
  1405. self.save_model(request, new_object, form, not add)
File "e:\python\lib\site-packages\django\contrib\admin\options.py" in
save_model
  1046. obj.save()
File "e:\python\lib\site-packages\django\db\models\base.py" in save
  591.force_update=force_update,
update_fields=update_fields)
File "e:\python\lib\site-packages\django\db\models\base.py" in save_base
  619. updated = self._save_table(raw, cls, force_insert,
force_update, using, update_fields)
File "e:\python\lib\site-packages\django\db\models\base.py" in _save_table
  700. result = self._do_insert(cls._base_manager, using,
fields, update_pk, raw)
File "e:\python\lib\site-packages\django\db\models\base.py" in _do_insert
  733.using=using, raw=raw)
File "e:\python\lib\site-packages\django\db\models\manager.py" in
manager_method
  92. return getattr(self.get_queryset(), name)(*args,
**kwargs)
File "e:\python\lib\site-packages\django\db\models\query.py" in _insert
  921. return query.get_compiler(using=using).execute_sql(return_id)
File "e:\python\lib\site-packages\django\db\models\sql\compiler.py" in
execute_sql
  920. cursor.execute(sql, params)
File "e:\python\lib\site-packages\django\db\backends\utils.py" in execute
  85. sql = self.db.ops.last_executed_query(self.cursor, sql,
params)
File "e:\python\lib\site-packages\mysql\connector\django\base.py" in
last_executed_query
  371. return cursor.statement
File "e:\python\lib\site-packages\mysql\connector\django\base.py" in
__getattr__
  147. return getattr(self.cursor, attr)
File "e:\python\lib\site-packages\mysql\connector\cursor.py" in statement
  858. return self._executed.strip()

Exception Type: AttributeError at /admin/product/shop/add/
Exception Value: 'NoneType' object has no attribute 'strip'

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B6SYO33vgr8Y0VjS8GhWy5O5HxUJzakLxPAEvWbsREe5nEnsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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, 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 Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f6d948cd-c526-4d40-98f3-29ed44828b28%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BWjgXN%2BhK11jXX%2Bz2_2TQEfMUpWF2cFBcJf-r7ARc41D2eQmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f6d948cd-c526-4d40-98f3-29ed44828b28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 should work around the problem by avoiding autofill for 
the moment and slugify in the model.save method.




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
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
with your version of Django?

--

Jani Tiainen

--
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 it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/a1180919-7547-493a-856c-22252fa6678e%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/547E4315.60108%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


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 
>> 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 
>> with your version of Django? 
>>
>> -- 
>>
>> Jani Tiainen 
>>
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a1180919-7547-493a-856c-22252fa6678e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 
> with your version of Django? 
>
> -- 
>
> Jani Tiainen 
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2075fb9f-2430-4b15-93a6-23b64aefa9cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
with your version of Django?

-- 

Jani Tiainen

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20141201153155.67cb49bf%40jns42-l.w2k.keypro.fi.
For more options, visit https://groups.google.com/d/optout.


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

2014-12-01 Thread Danish Ali
I think it fails when it tries to stip content of name. Should I paste 
stacktrace here. Because I do not get any clue from stacktrace about the 
problem :/


On Monday, December 1, 2014 6:21:00 PM UTC+5, 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?
>
> On Mon, Dec 1, 2014 at 10:16 AM, Danish Ali <dan...@jotixtech.com 
> > wrote:
>
>> I am using admin to enter data.
>> This is the URL from where I am trying to save records: 
>> 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: 
>>>
>>> > 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 models 
>>> > from autoslug import AutoSlugField 
>>> > 
>>> > # Create your models here. 
>>> > 
>>> > class Shop(models.Model): 
>>> > name = models.CharField(max_length=200) 
>>> > image = models.CharField(max_length=200) 
>>> > description = models.TextField() 
>>> > slug = models.SlugField(null=True, blank=True) 
>>> > slug = AutoSlugField(populate_from='name') 
>>> > 
>>> > 
>>> > If I remove: slug = AutoSlugField(populate_from='name') then it works 
>>> fine. 
>>> > So, can someone tell me what is the issue here? 
>>>
>>> How are you trying to set data and trying to save to database (used 
>>> commands would be helpful) 
>>>
>>> -- 
>>>
>>> Jani Tiainen 
>>>
>>  -- 
>> 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 it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/b6a557f5-5a11-4f02-bc22-2823a49b9495%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/b6a557f5-5a11-4f02-bc22-2823a49b9495%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cdd855a3-322a-4baf-8b46-b8a450ba61a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-12-01 Thread Kelvin Wong
Post the full trace. I looked at the source for auto slug field and they 
don't use strip, so the source of this error must be somewhere else. You 
are looking for code like this:

slug = None
slug.strip()

K


On Monday, December 1, 2014 5:11:17 AM UTC-8, Danish Ali wrote:
>
> still same error.
>
> On Monday, December 1, 2014 5:36:52 PM UTC+5, WongoBongo wrote:
>>
>> 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 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 models
>>> from autoslug import AutoSlugField
>>>
>>> # Create your models here.
>>>
>>> class Shop(models.Model):
>>> name = models.CharField(max_length=200)
>>> image = models.CharField(max_length=200)
>>> description = models.TextField()
>>> slug = models.SlugField(null=True, blank=True)
>>> slug = AutoSlugField(populate_from='name')
>>>
>>>
>>> If I remove: slug = AutoSlugField(populate_from='name') then it works 
>>> fine. So, can someone tell me what is the issue here?
>>>
>>> Thanks 
>>>
>>>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f10a3be-1e44-4a14-8c7b-cce231ae1734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-12-01 Thread Vijay Khemlani
Have you tried following the stacktrace that resulted in the error?

Does it fail when trying to strip the contents of the "name" field?

On Mon, Dec 1, 2014 at 10:16 AM, Danish Ali <dan...@jotixtech.com> wrote:

> I am using admin to enter data.
> This is the URL from where I am trying to save records:
> 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:
>>
>> > 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 models
>> > from autoslug import AutoSlugField
>> >
>> > # Create your models here.
>> >
>> > class Shop(models.Model):
>> > name = models.CharField(max_length=200)
>> > image = models.CharField(max_length=200)
>> > description = models.TextField()
>> > slug = models.SlugField(null=True, blank=True)
>> > slug = AutoSlugField(populate_from='name')
>> >
>> >
>> > If I remove: slug = AutoSlugField(populate_from='name') then it works
>> fine.
>> > So, can someone tell me what is the issue here?
>>
>> How are you trying to set data and trying to save to database (used
>> commands would be helpful)
>>
>> --
>>
>> Jani Tiainen
>>
>  --
> 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 it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b6a557f5-5a11-4f02-bc22-2823a49b9495%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b6a557f5-5a11-4f02-bc22-2823a49b9495%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALn3ei28WYSWj9_LB33jWLyzS%3DqqPhkLtB83jGmMVkQUQm0R%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-12-01 Thread Danish Ali
I am using admin to enter data.
This is the URL from where I am trying to save 
records: 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: 
>
> > 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 models 
> > from autoslug import AutoSlugField 
> > 
> > # Create your models here. 
> > 
> > class Shop(models.Model): 
> > name = models.CharField(max_length=200) 
> > image = models.CharField(max_length=200) 
> > description = models.TextField() 
> > slug = models.SlugField(null=True, blank=True) 
> > slug = AutoSlugField(populate_from='name') 
> > 
> > 
> > If I remove: slug = AutoSlugField(populate_from='name') then it works 
> fine. 
> > So, can someone tell me what is the issue here? 
>
> How are you trying to set data and trying to save to database (used 
> commands would be helpful) 
>
> -- 
>
> Jani Tiainen 
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b6a557f5-5a11-4f02-bc22-2823a49b9495%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 database I get this error: Error: 'NoneType' object has 
> no attribute 'strip'
> 
> My model is:
> 
> from django.db import models
> from autoslug import AutoSlugField
> 
> # Create your models here.
> 
> class Shop(models.Model):
> name = models.CharField(max_length=200)
> image = models.CharField(max_length=200)
> description = models.TextField()
> slug = models.SlugField(null=True, blank=True)
> slug = AutoSlugField(populate_from='name')
> 
> 
> If I remove: slug = AutoSlugField(populate_from='name') then it works fine. 
> So, can someone tell me what is the issue here?

How are you trying to set data and trying to save to database (used commands 
would be helpful)

-- 

Jani Tiainen

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20141201151426.2fdd643f%40jns42-l.w2k.keypro.fi.
For more options, visit https://groups.google.com/d/optout.


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

2014-12-01 Thread Danish Ali
still same error.

On Monday, December 1, 2014 5:36:52 PM UTC+5, WongoBongo wrote:
>
> 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 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 models
>> from autoslug import AutoSlugField
>>
>> # Create your models here.
>>
>> class Shop(models.Model):
>> name = models.CharField(max_length=200)
>> image = models.CharField(max_length=200)
>> description = models.TextField()
>> slug = models.SlugField(null=True, blank=True)
>> slug = AutoSlugField(populate_from='name')
>>
>>
>> If I remove: slug = AutoSlugField(populate_from='name') then it works 
>> fine. So, can someone tell me what is the issue here?
>>
>> Thanks 
>>
>>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3e9fd72f-0f84-4015-aa5c-6606b95bc387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 models
> from autoslug import AutoSlugField
>
> # Create your models here.
>
> class Shop(models.Model):
> name = models.CharField(max_length=200)
> image = models.CharField(max_length=200)
> description = models.TextField()
> slug = models.SlugField(null=True, blank=True)
> slug = AutoSlugField(populate_from='name')
>
>
> If I remove: slug = AutoSlugField(populate_from='name') then it works 
> fine. So, can someone tell me what is the issue here?
>
> Thanks 
>
>

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16970138-6267-4711-bbc4-feb6371d2c43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 models
from autoslug import AutoSlugField

# Create your models here.

class Shop(models.Model):
name = models.CharField(max_length=200)
image = models.CharField(max_length=200)
description = models.TextField()
slug = models.SlugField(null=True, blank=True)
slug = AutoSlugField(populate_from='name')


If I remove: slug = AutoSlugField(populate_from='name') then it works fine. 
So, can someone tell me what is the issue here?

Thanks 

-- 
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 it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1e478e2-30df-490a-ac42-a4a669f26eab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.