Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DjangoField' object has no attribute 'empty_values' #102

Open
73VW opened this issue Sep 23, 2024 · 1 comment
Open

'DjangoField' object has no attribute 'empty_values' #102

73VW opened this issue Sep 23, 2024 · 1 comment

Comments

@73VW
Copy link

73VW commented Sep 23, 2024

Expected Behavior (Mandatory)

List of objects displaying correctly in admin.

Actual Behavior (Mandatory)

AttributeError: 'DjangoField' object has no attribute 'empty_values'

How to Reproduce the Problem

Not sure right now. Will keep this updated.

Simple Example

Datasets and Statements

Screenshots (where it's possibile)

image

image

Specifications (Mandatory)

Currently used versions

$ poetry show django-neomodel
 name         : django-neomodel        
 version      : 0.2.0                  
 description  : Use Neo4j with Django!

dependencies
 - django >=4.2.8
 - neomodel >=5.3.0,<5.4.0

Versions

  • OS: Docker container based on python:debian
  • Library:
  • Neo4j: neo4j:5.22-community
  • Django: django = "^5.0.7"
@73VW
Copy link
Author

73VW commented Sep 23, 2024

I've been able to fix the error locally by adding the following in the __init__.py

from django.core import validators

...


@total_ordering
class DjangoField(object):
    """
    Fake Django model field object which wraps a neomodel Property
    """

    is_relation = False
    concrete = True
    editable = True
    creation_counter = 0
    unique = False
    primary_key = False
    auto_created = False
    empty_values = list(validators.EMPTY_VALUES) # <- HERE

It seems that it has not changed in Django base field here since 2013. Adding this should not break backwards compatibility.

I am going to open a PR with this change so that we cas discuss it further.

73VW added a commit to 73VW/django-neomodel that referenced this issue Sep 23, 2024
This fixes an error occuring in django >=5.0

See neo4j-contrib#102 for more details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant