Django: access part of model with tags

I cloned a project from GH and one of things I did was add a DOB part to the user model. However whenever I try to access it through a template tag- it doesn’t work.

Can someone help???

user model
Form code

FYI- i tried

{{ user.birth_year }} 

is there some kind of database migration step you need?

well I already migrated as needed, I just want to access the model data like you would with (( user.email ))

It is a safe bet that wh0 mentioned it because there is no particular reason that things that worked prior to renaming the column should fail after renaming the column… except perhaps that it didn’t get renamed.

What I do in these cases is to write a simple function that queries the DB and place it in some startup code or an if (dbTest) block. Have it fetch data from the database. Obviously the column but anything else that may seem relevant, table names, the db schema, etc. You want to be certain the data is as you believe it to be if there is nothing up with the code.

1 Like

Thanks! I’ll give this a try

Hi, i tried what @tleylan said. The .schema command in sqlite throws up everything but this part I added.

So I made some changes and now it works! Thanks to all who helped