thanks Gourav. I really appreciate your inputs.
On Tue, Oct 3, 2017 at 9:16 PM, Gourav Chawla <
gauravchawla.chawla...@gmail.com> wrote:
> Glad, you worked it out. You can use them whenever you want. Function
> based views require you to write more code but give you more clarity on
> what's
Glad, you worked it out. You can use them whenever you want. Function based
views require you to write more code but give you more clarity on what's
happening. On the other hand CBV help you keep the codebase cleaner.
At the end of the day, it's you who has to decide what to use.
--
You
Holy .. it works!
I have to access the Team_Name class using the 'related_name=regions' and
from that, I was able to access the logo attributes of Team_Name.
Here's what I did.
{% block body_block %}
{% for region in regions_detail.regions.all %}
Hi Gourav, thanks for the input.
Just a question, Can I iterate through the Team_Region to get the teams
listed under the specific id? or shall I do it in Team_Member class? This
is for the DetailView.
On Mon, Oct 2, 2017 at 9:31 PM, Gourav Chawla <
gauravchawla.chawla...@gmail.com> wrote:
>
You can create another url, view, template to do that.
Just create a url like : team/id
For the above url create a view, say, teams_under_region which accepts the
'id'. Based on that id you can then query your database for teams where
region_member=id. This is just the approach you would
Hi guys, I just want to know how to access and load the data associated to
a primary key in a template.
models.py
class Team_Region(models.Model):
name = models.CharField(max_length=50)
# String representation
def __str__(self):
return self.name
class
6 matches
Mail list logo