Greetings,

I am trying to do a join on the following 2 models (tables)

class Rio1(models.Model):
    datestr = models.DateTimeField()
    source = models.TextField()
    dFlag = models.TextField()
    url = models.TextField()

    class Meta:
        managed = False
        db_table = 'rio1'

class Rio2(models.Model):
    datestr = models.DateTimeField()
    source = models.TextField()
    dFlag = models.TextField()
    url = models.TextField()

    class Meta:
        managed = False
        db_table = 'rio2'


In each table there is a primary ID column, but it does not have the same 
values in both tables, only datestr and source are the identical, now the 
trick is that both datestr and source are appearing 4 times per every 
single day, hence I can't set datestr or source to be unique primary keys. 

When I did a simple dummy join, the Django query yields no results because 
it is joing on the ID column which is of course won't bring back any 
matched records from the two tables. What would be the correct way to join 
such tables?

Many thanks!











-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1792f5ee-7858-4987-b2fc-246eb74e16e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to