martsberger / django-joinfield Goto Github PK
View Code? Open in Web Editor NEWA field type for Django models that allows joins to a related model without a foreign key
License: MIT License
A field type for Django models that allows joins to a related model without a foreign key
License: MIT License
Cool implementation. How can I send $5 as a tip?
Does this library work with data models from two different database?
The data models in my situation has a table in Database A and a look up table in Database B. I am trying to left join the table to its look up table. Since the two are from different database, will this library work?
First of all thank you for making the solution open source. I am using it in my project but am stuck with reverse relationship.
Here are my models
class Collections(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=200)
description = models.CharField(max_length=2000)
....
class Meta:
db_table = 'collections'
class CollectionViews(models.Model):
id = models.BigAutoField(primary_key=True)
collection_id = JoinField(Collections,on_delete=models.DO_NOTHING,db_column='collection_id',to_field='id')
page = models.CharField(max_length=100)
....
class Meta:
db_table = 'collection_views'`
Am able to do forward filters, but backward relationship fails this is my code for reverse relationship
Collections.objects.filter(collection_views__page="listing")
also tried with actual model name
Collections.objects.filter(collectionviews_page='listing')
I receive this error
Cannot resolve keyword 'collectionviews' into field. Choices are: name, description......
It tries to find the collectionviews in the field list but its a model.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.