primal100 / django_postgres_extensions Goto Github PK
View Code? Open in Web Editor NEWExtra functionality for django.contrib.postgres
Home Page: http://django-postgres-extensions.readthedocs.io/en/latest/
License: Other
Extra functionality for django.contrib.postgres
Home Page: http://django-postgres-extensions.readthedocs.io/en/latest/
License: Other
Hi, thank you for this library. However, I cannot import the ArrayManyToMany field. I am using version, 0.9.3
Thanks.
https://github.com/primal100/django_postgres_extensions/archive/master.zip#egg=django_postgres_extensions==0.9
from django_postgres_extensions.models import ArrayField as DJPEArrayField
class MyModel(models.Model):
tags = DJPEArrayField(models.CharField(max_length=24), null=True, blank=True)
operations = [
migrations.CreateModel(
name='MyModel',
fields=[
('tags', django_postgres_extensions.models.fields.ArrayField(base_field=models.CharField(max_length=24), blank=True, form_size=None, null=True, size=None)),
],
),
]
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 89, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
self.loader = MigrationLoader(self.connection)
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 49, in __init__
self.build_graph()
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 170, in build_graph
self.load_disk()
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 105, in load_disk
migration_module = import_module("%s.%s" % (module_name, migration_name))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/rowend/Projects/buckets/bucketspm/main/migrations/0087_mymodel.py", line 13, in <module>
class Migration(migrations.Migration):
File "/Users/rowend/Projects/buckets/bucketspm/main/migrations/0087_mymodel.py", line 28, in Migration
('tags', django_postgres_extensions.models.fields.ArrayField(base_field=models.CharField(max_length=24), blank=True, form_size=None, null=True, size=None)),
File "/Users/rowend/Projects/buckets/venv/lib/python2.7/site-packages/django/contrib/postgres/fields/array.py", line 30, in __init__
super(ArrayField, self).__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'form_size'
('tags', django_postgres_extensions.models.fields.ArrayField(base_field=models.CharField(max_length=24), blank=True, null=True, size=None)),
i'm using postgis backend in my setting and i doubt about changing it to this package
Hi, on version 0.9.3, it is does not ship with the templates directory. So it is unable to load nested_form_widget.html.
Thanks
for Python 3.4.3:
pip install django-postgres-extensions
Collecting django-postgres-extensions
Using cached django_postgres_extensions-0.91.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/pf/rd6y8q8x5yldbz4m1mb7xdyr0000gn/T/pip-build-r9fif_w7/django-postgres-extensions/setup.py", line 8, in
long_description=open('readme.md').read(),
FileNotFoundError: [Errno 2] No such file or directory: 'readme.md'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/pf/rd6y8q8x5yldbz4m1mb7xdyr0000gn/T/pip-build-r9fif_w7/django-postgres-extensions/
Received the following error while installing this lib according to the docs.
root@4ae4fe029e54:/app# ./manage.py makemigrations
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 115, in load_backend
return import_module('%s.base' % backend_name)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/usr/local/lib/python3.6/site-packages/django_postgres_extensions/backends/postgresql/base.py", line 3, in <module>
from .creation import DatabaseCreation
File "/usr/local/lib/python3.6/site-packages/django_postgres_extensions/backends/postgresql/creation.py", line 1, in <module>
from django.contrib.postgres.signals import register_hstore_handler
ImportError: cannot import name 'register_hstore_handler'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
File "/usr/local/lib/python3.6/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/usr/local/lib/python3.6/site-packages/django/contrib/sessions/models.py", line 3, in <module>
from django.contrib.sessions.base_session import (
File "/usr/local/lib/python3.6/site-packages/django/contrib/sessions/base_session.py", line 30, in <module>
class AbstractBaseSession(models.Model):
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 124, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/local/lib/python3.6/site-packages/django/db/models/options.py", line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/usr/local/lib/python3.6/site-packages/django/db/__init__.py", line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 211, in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 134, in load_backend
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django_postgres_extensions.backends.postgresql' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
Error was: cannot import name 'register_hstore_handler'
Hello!
I use model from the example of ArrayManyToManyField:
class Publication(models.Model):
title = models.CharField(max_length=30)
def __str__(self):
return self.title
class Meta:
ordering = ('title',)
class Article(models.Model):
headline = models.CharField(max_length=100)
publications = ArrayManyToManyField(Publication, name='publications')
def __str__(self):
return self.headline
class Meta:
ordering = ('headline',)
And after I start command makemigrations I get error:
RecursionError: maximum recursion depth exceeded in comparison
Could you help ?
Commit fb25efd229d8be243467a5094815b15f00f80bf7 just disappeared.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.