Re: AttributeError: 'module' object has no attribute 'SubfieldBase'

2017-08-07 Thread Tim Graham
>From https://bitbucket.org/schinckel/django-timedelta-field: "If you are 
using Django 1.8 or greater (and you really _should_ be), then you should 
use the included DurationField() instead of this. This field does not work 
with Django 1.10, and will probably not be updated to fix the issue(s). 
When migrating TimedeltaField to DurationField using Django migrations, 
alter any migrations that have an import to this library to mention the new 
field type, this works to prevent Django from crashing when trying to run 
the deprecated code."

On Monday, August 7, 2017 at 3:52:15 PM UTC-4, ahmed dawod wrote:
>
> I'm working on a project that was built using an earlier version of 
> django. My environment has the latest Django version (1.11.4). 
> When I try to "python manage.py runserver" I get this: 
>
> Unhandled exception in thread started by >> 0x7fb1dab36cf8>
>>
>> Traceback (most recent call last):
>>
>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>>> 228, in wrapper
>>
>> fn(*args, **kwargs)
>>
>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
>>>  
>>> line 117, in inner_run
>>
>> autoreload.raise_last_exception()
>>
>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>>> 251, in raise_last_exception
>>
>> six.reraise(*_exception)
>>
>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>>> 228, in wrapper
>>
>> fn(*args, **kwargs)
>>
>>   File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 
>>> 27, in setup
>>
>> apps.populate(settings.INSTALLED_APPS)
>>
>>   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", 
>>> line 108, in populate
>>
>> app_config.import_models()
>>
>>   File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", 
>>> line 202, in import_models
>>
>> self.models_module = import_module(models_module_name)
>>
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
>>> import_module
>>
>> __import__(name)
>>
>>   File 
>>> "/home/ahmedn1/Documents/Paymob/wallet_executive_panel-master-c109bd6fe9cd1bf793c11a5c2e97d18a1887c3ba/accounts/models.py",
>>>  
>>> line 8, in 
>>
>> import timedelta
>>
>>   File "/usr/local/lib/python2.7/dist-packages/timedelta/__init__.py", 
>>> line 11, in 
>>
>> from .fields import TimedeltaField
>>
>>   File "/usr/local/lib/python2.7/dist-packages/timedelta/fields.py", line 
>>> 18, in 
>>
>> class TimedeltaField(six.with_metaclass(models.SubfieldBase, 
>>> models.Field)):
>>
>> AttributeError: 'module' object has no attribute 'SubfieldBase'
>>
>>
> So the problem is with the django-timedeltafield package but its version 
> is 0.7.10 which is the latest version. So, why does it still have a problem 
> with this deprecated SubfieldBase? 
>
> What should I do to solve the 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 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/432839fb-0640-470f-a84a-7a107f4883f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


AttributeError: 'module' object has no attribute 'SubfieldBase'

2017-08-07 Thread ahmed dawod
I'm working on a project that was built using an earlier version of django. 
My environment has the latest Django version (1.11.4). 
When I try to "python manage.py runserver" I get this: 

Unhandled exception in thread started by > 0x7fb1dab36cf8>
>
> Traceback (most recent call last):
>
>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>> 228, in wrapper
>
> fn(*args, **kwargs)
>
>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
>>  
>> line 117, in inner_run
>
> autoreload.raise_last_exception()
>
>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>> 251, in raise_last_exception
>
> six.reraise(*_exception)
>
>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>> 228, in wrapper
>
> fn(*args, **kwargs)
>
>   File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 
>> 27, in setup
>
> apps.populate(settings.INSTALLED_APPS)
>
>   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", 
>> line 108, in populate
>
> app_config.import_models()
>
>   File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", 
>> line 202, in import_models
>
> self.models_module = import_module(models_module_name)
>
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
>> import_module
>
> __import__(name)
>
>   File 
>> "/home/ahmedn1/Documents/Paymob/wallet_executive_panel-master-c109bd6fe9cd1bf793c11a5c2e97d18a1887c3ba/accounts/models.py",
>>  
>> line 8, in 
>
> import timedelta
>
>   File "/usr/local/lib/python2.7/dist-packages/timedelta/__init__.py", 
>> line 11, in 
>
> from .fields import TimedeltaField
>
>   File "/usr/local/lib/python2.7/dist-packages/timedelta/fields.py", line 
>> 18, in 
>
> class TimedeltaField(six.with_metaclass(models.SubfieldBase, 
>> models.Field)):
>
> AttributeError: 'module' object has no attribute 'SubfieldBase'
>
>
So the problem is with the django-timedeltafield package but its version is 
0.7.10 which is the latest version. So, why does it still have a problem 
with this deprecated SubfieldBase? 

What should I do to solve the 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 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/899c222e-24b5-4603-819c-e36d51ead175%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.