Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8868391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:15:44+00:00 2026-06-14T17:15:44+00:00

This seems like a bug but I just want to make sure I’m consuming

  • 0

This seems like a bug but I just want to make sure I’m consuming the API properly.

It seems that support for django’s modelform isn’t supported on neo4django. Here’s what I have:

Simple class:

from neo4django.db import models

class Person(models.NodeModel):
name = models.StringProperty()

The modelform:

class PersonForm(forms.ModelForm):
class Meta:
model = Person

Will trigger exception:

‘super’ object has no attribute ‘editable’

I posted details as an issue:
https://github.com/scholrly/neo4django/issues/135

Because when Django goes to lookup field information using the model’s _meta information, it finds a BoundProperty instead of a StringProperty or Property (which has a member called ‘editable’, but BoundProperty doesn’t).

Is there a workaround, or is this an actual bug? Any ideas on how to fix the bug? I’m not familiar with the library codebase.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:15:45+00:00Added an answer on June 14, 2026 at 5:15 pm

    Below is a reasonable (and quick) workaround for anyone using neo4j with Django.

    This solution requires that field names on the form have the exact same name as the attributes of the model.

    Inherit the form from this class and set the model under the form class Meta class:

    class NeoModelForm(forms.Form):
        def __init__(self, *args, **kwargs):
            super(NeoModelForm, self).__init__(*args, **kwargs)
            self._meta = getattr(self, 'Meta', None)
            if not self._meta:
                raise Exception('Missing Meta class on %s' % str(self.__class__.__name__))
            if not hasattr(self._meta, 'model'):
                raise Exception('Missing model on Meta class of %s' % str(self.__class__.__name__))
    
        def save(self, commit=True):
            if not self.is_valid():
                raise Exception('Failed to validate')
            instance = self._meta.model(**self.cleaned_data)
            if commit:
                instance.save()
            return instance
    

    Now you can create a form class like this:

    class PersonForm(NeoModelForm):
        name = forms.CharField(widget=forms.TextInput())
        class Meta:
            model = Person
    

    And still be able to save a model instance from a valid form:

    form = formclass(request.POST)
    if form.is_valid():
        obj = form.save()
    

    Plus the commit argument will give you the same solution as django’s modelform class- but I didn’t bother to implement to save_m2m functionality (which doesn’t seem relevant for neo4j as a backend).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This really seems like a bug to me, but perhaps some databinding gurus can
This seems like a bug to me... I accept that automatic properties, defined as
Can anyone recreate this issue? It seems to me like a quite serious bug
This seems like a repeated question but i'm not able to get my answer.
This seems like such a simple issue but I cannot find an elegant solution.
This seems like the simplest Git question, but I can't find ANYTHING on it.
This seems like something that could be quite useful and yet and I can't
This seems like a must have form input for a mobile ui framework, but
This seems like another fairly simple thing to do, but I'm again struggling on
I often find I want to write code something like this in C#, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.