I'm not sure this will work but you could try creating a VIEW on the
database side that does the union there and access it through an un-managed
model.
CREATE VIEW *view_name* AS SELECT id, name FROM *a* UNION SELECT id, name
FROM *b*;
class C(models.Model):
name = models.CharField()
On 4/16/14 11:51 PM, Shoaib Ijaz wrote:
I don't want use SQL query in django
OK. You *could* have class B inherit from class A:
class B(A):
link = models.IntegerField(blank=True, null=True)
and then do your query on A:
ulist = A.objects.all()
hth
- Tom
On Th
I don't want use SQL query in django
On Thursday, 17 April 2014 04:39:09 UTC+5, Russell Keith-Magee wrote:
>
> On Wed, Apr 16, 2014 at 9:30 PM, Shoaib Ijaz
> >
> wrote:
> > Sorry for duplicate post How to create Union
> >
> > I am using Django REST Framework in project and I want to create un
On Wed, Apr 16, 2014 at 9:30 PM, Shoaib Ijaz wrote:
> Sorry for duplicate post How to create Union
>
> I am using Django REST Framework in project and I want to create union two
> different Models.
>
> My Models
>
> class A(models.Model):
> name = models.CharField(max_length=240, blank=True)
>
4 matches
Mail list logo