List Info

Thread: Recent failure with generic foreign keys and sqlite3 memory database




Recent failure with generic foreign keys and sqlite3 memory database
user name
2006-11-12 03:14:09
Generic foreign keys and the sqlite3 memory database (for
unit testing)
have recently stopped working for me.  I upgraded my sqlite3
version
and Django, so am not sure what change caused the problem.

Following is a simple models file that demonstrates the
problem.  I
have no problem when using sqlite with a file-based
database.

Versions of software I'm running:
Django: Today's trunk
sqlite3: 3.3.7_0+darwin_8
pysqlite: 2.3.2

Model file:
-----------------------------------------------
from django.db import models
from django.contrib.contenttypes.models import ContentType


def test_all():
    """
    >>> msg = Message(title="hi")
    >>> msg.save()
    >>> msg
    <Message: Message object>

    >>> tag =
msg.tags.create(tag="sometag")
    >>> tag
    <Tag: Tag object>

    >>> assert tag.content_object is not None
    """

class Tag(models.Model):
    tag = models.SlugField()

    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = models.GenericForeignKey()


class Message(models.Model):
    title = models.CharField(maxlength=100)
    tags = models.GenericRelation(Tag)


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Recent failure with generic foreign keys and sqlite3 memory database
user name
2006-11-22 18:17:03
Hi Ron,

I'm running into the exaxt same issue.
Have you been able work around it?

Best,

-jelle


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Recent failure with generic foreign keys and sqlite3 memory database
user name
2006-11-22 19:39:01
Nope, haven't worked around it with Sqlite.  I switched to
MySQL and  
don't have the problem there.

I wanted to turn on SQL statement logging in Django to see
if I could  
narrow down the problem, but didn't find the setting to
enable it.

Ron


On Nov 22, 2006, at 12:17 PM, jelle wrote:

>
> Hi Ron,
>
> I'm running into the exaxt same issue.
> Have you been able work around it?
>
> Best,
>
> -jelle
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )