#100DaysofCode Day 12

I fully admit I’m slacking with the documenting– I’m getting so wrapped up in whatever’s caught my eye that day, that I forget to jot it down here after I jot it down in my notebook when it’s time to walk away for the day. (as an aside: all this learnin’ has reminded me how much I love to just WRITE stuff in notebooks. I retain everything a lot better if I physically write it with a pen and paper. So far I’ve gone through half a box of pens, and countless random pens, several notebooks, and my hands are TIRED.)

I’ve been working with Django more. Current project: a CATalogue of my cats. (get it? CATalogue?) I’ve created the model and the view(s) and next on my agenda is to figure out how to get image files in on this action. Because what’s the point of cataloguing my cats, if I’m not including pictures with adorable captions and descriptions?

example: models.py
from django.db import models
class CatProfile(models.Model):
cat_name = models.CharField(max_length=200)
# should change this to approximate year of birth:
cat_age = models.IntegerField("cat's age")
cat_desc = models.CharField(max_length=200)
def __str__(self):
return self.cat_name
def elderly(self):
return self.cat_age >= 10
elderly.short_description = 'Is this cat a senior?'

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.