Re: specefic field(s) for each query.

2020-01-12 Thread ACG
El sábado, 11 de enero de 2020, 18:38:44 (UTC+1), Mohsen Pahlevanzadeh escribió: > > Hello everybody, > > I can write django code for "select * from mytables;", but I can't > specefic fields such as "select field(s) from my table;" > > Please help me.. > Hi, first you may connect, is ex

specefic field(s) for each query.

2020-01-11 Thread Santhosh sridhar
You can query like this in Django, say A is the table name and B is the columns. A.objects.all().values('B') or A.objects.all().values_list('B',flat=True) Regards, San -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

Re: specefic field(s) for each query.

2020-01-11 Thread 山村維宏
use values(). example: Foo.objects.filter(name='foo').values('bar', 'baz') 2020年1月12日(日) 2:38 Mohsen Pahlevanzadeh : > Hello everybody, > > I can write django code for "select * from mytables;", but I can't > specefic fields such as "select field(s) from my table;" > > Please help me.. > > -

specefic field(s) for each query.

2020-01-11 Thread Santhosh sridhar
You can query like this in Django, say the table name is A and column name is name. A.objects.all() will give all the objects and A.objects.filter(name='Django') will give all the objects whose name is Django. -- You received this message because you are subscribed to the Google Groups "Django

specefic field(s) for each query.

2020-01-11 Thread Mohsen Pahlevanzadeh
Hello everybody, I can write django code for "select * from mytables;", but I can't specefic fields such as "select field(s) from my table;" Please help me.. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group a