Code Monkey home page Code Monkey logo

Comments (3)

derdritte avatar derdritte commented on September 28, 2024

I just ran into this as well, it was the comments that did it for me (I have a pages & blog mix deployed right now).
If anybody is curious I used the "is_private" attribute on the request to make it usable for now.

if hasattr(request, 'is_preview') and request.is_preview:
    alternate-expression
else:
    double-underscore-expression

from django-modelcluster.

gasman avatar gasman commented on September 28, 2024

Implemented in #102 for expressions such as __lt. Following relations (e.g. page.photos.filter(author__name='Matthew')) and chaining (e.g. publish_date__year__gt=2017 are still outstanding, so leaving this issue open to cover those.

from django-modelcluster.

bcdickinson avatar bcdickinson commented on September 28, 2024

I think this is probably related to this issue...

We've run into AttributeErrors with ordering on fields in related models (being thrown here in utils.sort_by_fields: https://github.com/wagtail/django-modelcluster/blob/master/modelcluster/utils.py#L19)

Example code that produces this:

class ItemValue(models.Model):
    item = models.ForeignKey(...)

    class Meta:
        ordering = ("item__title")

The error thrown is AttributeError: 'ItemValue' object has no attribute 'item__title'.

This is happening when the ItemValue is being saved from an inline formset on a parent model.

from django-modelcluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.