Jason Hasselkus

A whole lot of something for nothing

Jason Hasselkus header image 2

Left Side Lids - The Model

June 12th, 2008 · No Comments

Now is the point where I really start to jump into the goodness of Django. The admin is just one of the frameworks “Killer” features, but I really like the automatic sql injection that it does for me. This allows me to create a dynamic site with very little code. The piece that makes this all happen is the model, and that’s what I’m going to create now.
When thinking about the model for this site, I broke it down into several different pieces. Meaning that I needed to create separate models for different functions. Or in Django terms I will create multiple applications. We know that there must be a blog, and we can’t sell anything without there being a store, so those will be our first major focus.
I decided to start with the store function because that’s probably the most important piece of the puzzle (what good is a site to sell hats if you can’t actually buy one). In thinking about what a hat must have in terms of a shopping cart, I came up with the following.

  • Title - This will be the name of the hat. Like “red dot that stands out”, something of that nature, and it should be unique as well.
  • Description - Nobody wants to buy something that they don’t know anything about.
  • Price - We aren’t giving these things away, so there needs to be some purchase price.
  • Color - People probably want to know the color of the hat.
  • Style - This should be important to know, especially when it comes to fitted hats or one-size-fits all.
  • Available Sizes - When a flexfit hat isn’t used, they’ll be fitted or some other type of hat.
  • Availability - Since we are running a limited number of hats, it probably makes sense to have a “Sold Out” and “Available” flag.
  • Tags - Just like a blog, it makes sense that a tag of some sort be assigned to a particular hat. If a guest designer is designing the hat, it should be tagged for quick search and organization.
  • Category - A category is important, especially when it comes to sorting. Possible categories could be: Men, Women, Flexfit, Youth, etc..
  • Images - A site, especially an ecommerce site isn’t really useful if it doesn’t have images. We’ll need at least one image for the main page, but could use additional images for different views.

That should pretty much cover what goes into the attributes of a hat. Pretty simple stuff, but there are pieces that we’ll need to capture that might not show up on the live site. Meta data should be captured for each individual hat, which will help with SEO and searching the site. Some of the meta data that we’ll want to capture are as such.

  • Keywords - We all know that keywords to google are a major contributor when it comes to the google search engine.
  • Description - This might be different that the description used for the main hat. This should be more search engine ready.
  • Slug - generally a term used in the online news publishing, but we’ll use it to make our urls really nice and search engine friendly.
  • Designer - When a guest designer has a hat available, then this should be captured. We can take care of the filtering when it comes templates design (future post).
  • Created Date - This is useful for admin purposes really, and it’s something we’ll take more advantage of when it comes to the blog, but here we’ll use it to see when a particular hat was added into the system.
  • Views - No this isn’t a Django view, but an indicator on how many times a particular hat was viewed on the page. Each hat will have an individual page, so it makes sense to see what the most popular selections are.
  • Last Accessed - We might want to see when the last time a particular hat was accessed, meaning when was the last time a certain hat was viewed. This will help us determine whether or not a hat should be removed from the site or maybe it needs to be reintroduced. Again this is another field that’s more or less used for the admin.

That should pretty much cover the meta data that needs to be captured for a hat object. In thinking about the bigger picture of the site, and what features we might want to add in the future, it makes sense to get them down now, so that we can build them into our model. It’s much easier to have things in the model now, than trying to add them later. Not that you can’t do it, it just makes things easier. So here is some functionality that I know I will want in the future.

  • A Top 10 - or some number of the most viewed and popular hats.
  • Search - pretty self explanatory here.
  • Tag Cloud - Again this is more blogish, but it’s still something I’ll want in the future.

So for starters I think this is enough for now. Creating the model is the easy process, getting the templates design to display the data is the tougher part. So for now I’ll start creating my model and then getting some data put into the system.

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Categories: Web Design

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.