On 12/2/18 16:20, Lylio wrote:
> 1. To click on a card so it opens up and displays the details, am I right
> to say I should create a card.html file in the templates folder for this?
It isn't necessary, but it is a good idea
What you need is to create a view that renders such template.
I suggest you write your own view function that does that, but what
you'd usually do is just use a generic view and either pass it the
template you want to use, or name the template in a way the generic view
will find it on its own.
> 2. I'm confused about how Django keeps track of the cards in my app - I
> presume each card object has an ID in the database and I'd need this
> order to retrieve the card's details when it's clicked - but I'm
> how to link the two. In the two pictures above, say someone clicked on
> 'class progression' card on the left... I'd like a new page to open up
> display the details for that card and allows the user to edit the info or
> completely delete the card.
Yes, in general, every Django model instance has an id (unless you
specifically tell it not to), and you can use it to create urls for the
detail view I mentioned earlier. This is a good start, but you'll later
want to add a SlugField to your Card model, and use that instead of the
id so urls look nicer.
> I'm maybe asking a bit much here - but I'm unsure of how complex these
> requirements are. It feels like it should be *fairly *straightforward.
> thoughts or advice would be greatly appreciated.
I can assure you using Django for a project like yours is *very*
When in doubt, revisit the Django tutorial. This part is a good one for
where you're at: https://docs.djangoproject.com/en/2.0/intro/tutorial03/
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.