Code Monkey home page Code Monkey logo

Comments (5)

vdboor avatar vdboor commented on June 19, 2024 2

Thanks! I see now what's happening. This is because Django's "GenericForeignKey" uses a Text field for the ID field. In postgres, this breaks with fields that store the data in a UUIDField.

This is clearly an issue for https://github.com/django/django-contrib-comments, as they've implemented the base model that we build upon.

from django-fluent-comments.

vdboor avatar vdboor commented on June 19, 2024

I'm cleaning up old issues, I'm presuming this is already fixed.

This looks like an Django issue.

from django-fluent-comments.

bashu avatar bashu commented on June 19, 2024

I'm cleaning up old issues, I'm presuming this is already fixed.

@vdboor no, it's not! Here an example:

import uuid

class ArticlesTable(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)

    comments_set = CommentsRelation()

and running this query:

 ArticlesTable.objects.filter(comments_set__isnull=False)

gives me:

UndefinedFunction                         Traceback (most recent call last)
/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py in _execute(self, sql, params, *ignored_wrapper_args)
     84             else:
---> 85                 return self.cursor.execute(sql, params)
     86

UndefinedFunction: operator does not exist: uuid = text
LINE 1: ... JOIN "django_comments" ON ("recipes_recipe"."id" = "django_...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

from django-fluent-comments.

bashu avatar bashu commented on June 19, 2024

@vdboor as a hint: https://alexgaynor.net/2010/may/04/cool-new-django-taggit-api/

from django-fluent-comments.

vdboor avatar vdboor commented on June 19, 2024

Ah that's indeed how it should be implemented. This is one for https://github.com/django/django-contrib-comments though, as we mainly provide nice Ajax UI fluff on top of it!

from django-fluent-comments.

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.