I have two tables and want to join them.. but I can't do that without rawQueryset and raw SQL.
how can i join two models without foreign key? The columns for JOIN is not unique so it can't be PK and Foreign Key.
I want to get the SQL LIKE THIS
'SELECT * FROM genome AS A JOIN metadata AS B ON A.query_id = B.sample_id',
and this the models I used.
class Genome(models.Model):query_id = models.CharField(max_length=100) ref_id = models.CharField(max_length=30)matching_hashes = models.CharField(max_length=30)
class Metadata(models.Model):project_id = models.CharField(max_length=50) # Metagenome의 query id와 JOIN함sample_id = models.CharField(max_length=50)