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..
>
>
Maybe you should use ListView, not DetailView.
2019年11月25日(月) 19:44 Manos Zeakis :
> Hi
>
> I have declared a model and the simple views I created are working.
>
> Now I am trying to move to generic views.
>
> So I added in urls.py
>
> path('book2//', views.DetailView.as_view(),
Sorry, I mistaked.
You can use Detail view.
DetailView pass your model data, which named "book"(because model name is
Book).
Model doesn't list.
2019年11月25日(月) 19:44 Manos Zeakis :
> Hi
>
> I have declared a model and the simple views I created are working.
>
> Now I am trying to move to
3 matches
Mail list logo