<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aimee LaPlant</title>
	<atom:link href="http://aimeelaplant.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aimeelaplant.com</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 22:37:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>No, your cell phone does not have a Facebook name</title>
		<link>http://aimeelaplant.com/2012/02/no-your-cell-phone-does-not-have-a-facebook-name/</link>
		<comments>http://aimeelaplant.com/2012/02/no-your-cell-phone-does-not-have-a-facebook-name/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 09:24:49 +0000</pubDate>
		<dc:creator>Aimee LaPlant</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://aimeelaplant.com/?p=129</guid>
		<description><![CDATA[ Your cell phone does not have a name! The name belongs to an early Facebook user!]]></description>
			<content:encoded><![CDATA[<p><a href="http://aimeelaplant.com/wp-content/uploads/2012/02/your_cell_phone_facebook_name.jpeg"><img class="alignright size-medium wp-image-130" title="Your cell phone has no Facebook name." src="http://aimeelaplant.com/wp-content/uploads/2012/02/your_cell_phone_facebook_name-300x214.jpg" alt="your cell phone has a facebook name" width="300" height="214" /></a>An obnoxious yellow image saying <strong>Your Cell Phone has a name!</strong> has made its way onto my newsfeed with thousands of comments. I tried it myself on my own status (because I&#8217;m not keen on liking or commenting on public feeds), and I got &#8220;Matt Moon.&#8221; Now, this guy&#8217;s name is popping up for those whose phone numbers end in 409. His profile ID number is actually 409: <a title="https://www.facebook.com/profile.php?id=409" href="https://www.facebook.com/profile.php?id=409">http://www.facebook.com/profile.php?id=</a><strong><a title="https://www.facebook.com/profile.php?id=409" href="https://www.facebook.com/profile.php?id=409">409</a></strong>. I figured this was some code thing with the @[] tags, so I popped in the number for the Facebook profile url. You can use numbers from 100 to 999. Any numbers below 100 or above 999 seem to not work.</p>
<p>You will also notice that several of these people graduated from Harvard &#8211; where Facebook began &#8211; so their profile IDs <em>would</em> have low numbers, compared to mine which is 355571664452867. I joined Facebook around 2006!</p>
<p>Sorry, everyone. This isn&#8217;t Facebook magic, but whoever came up with this is quite the jokester!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeelaplant.com/2012/02/no-your-cell-phone-does-not-have-a-facebook-name/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Where is the very important &#8216;excerpt&#8217;, WordPress 3.3.1?</title>
		<link>http://aimeelaplant.com/2012/01/where-is-the-very-important-excerpt-wordpress-3-3-1/</link>
		<comments>http://aimeelaplant.com/2012/01/where-is-the-very-important-excerpt-wordpress-3-3-1/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 07:14:52 +0000</pubDate>
		<dc:creator>Aimee LaPlant</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://aimeelaplant.com/?p=84</guid>
		<description><![CDATA[Because I installed a completely new WordPress installation for this website, I thought WordPress removed the Excerpt field. ]]></description>
			<content:encoded><![CDATA[<p>I was freaking out, people! Using WordPress version 3.3.1, I thought WP got rid of the Excerpt table. Besides the title, the excerpt is simply one of my favorite SEO tools.</p>
<p>So, I missed this part. Just click on Screen Options at the top right corner when creating a new post and select the fields you want shown on the screen. I&#8217;ve enabled them all.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-91" title="The excerpt field is disabled by default in WordPress 3.1+ if you hadn't previously used it." src="http://aimeelaplant.com/wp-content/uploads/2012/01/Screen-shot-2012-01-30-at-1.09.52-AM.jpg" alt="screen options wordpress" width="501" height="203" /></p>
<p>The excerpt field is disabled by default in WordPress 3.1+ if you hadn&#8217;t previously used it. I&#8217;ve always used it, and having installed a new WordPress on this site, I didn&#8217;t know this happened. But phew!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeelaplant.com/2012/01/where-is-the-very-important-excerpt-wordpress-3-3-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to prepopulate a slug field from a foreign key in Django</title>
		<link>http://aimeelaplant.com/2012/01/how-to-prepopulate-a-slug-field-from-a-foreign-key-in-django/</link>
		<comments>http://aimeelaplant.com/2012/01/how-to-prepopulate-a-slug-field-from-a-foreign-key-in-django/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 16:50:34 +0000</pubDate>
		<dc:creator>Aimee LaPlant</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://aimeelaplant.com/?p=25</guid>
		<description><![CDATA[How to edit your models.py file and use the 'def save()' to prepopulate a slug with a foreign key in your Django application.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://comics.emmafrostfiles.com/">Emma Frost Comic Book Database</a> was my first <a href="https://www.djangoproject.com/">Django</a> project when I was familiarizing myself with the web framework and the Python programming language.</p>
<p>The models for the comic book database seemed relatively easy, but I came across problems that I didn&#8217;t consider, such as prepopulating a slug field from a foreign key. The comic book Title is a foreign key that goes into the Issue model. Selecting a title from a drop-down list should automatically prepopulate the slug field if defined in the admin.py, right? Nope, it comes up blank and will only prepopulate character fields &#8211; which is most likely a front-end Javascript issue.</p>
<p>Thanks to <a href="http://www.justinmyers.net/">Justin Myers</a>, he came up with a simple, bang-your-head-on-the-desk solution for generating slugs from foreign keys that I&#8217;d like to share since it is a common question.</p>
<p>Here&#8217;s how to do it, given an abbreviated example of my models.py file:</p>
<pre>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="kw1">class</span> Title<span class="br0">&#40;</span>models.<span class="me1">Model</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; title = models.<span class="me1">CharField</span><span class="br0">&#40;</span>max_length=64<span class="br0">&#41;</span>
&nbsp; &nbsp; slug = models.<span class="me1">SlugField</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp; &nbsp; <span class="kw1">def</span> get_absolute_url<span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="st0">&quot;/titles/%s&quot;</span> <span class="sy0">%</span> <span class="kw2">self</span>.<span class="me1">slug</span>
&nbsp; &nbsp; <span class="kw1">def</span> <span class="kw4">__unicode__</span><span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">self</span>.<span class="me1">title</span>

<span class="kw1">class</span> Issue<span class="br0">&#40;</span>models.<span class="me1">Model</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; title = models.<span class="me1">ForeignKey</span><span class="br0">&#40;</span>Title<span class="br0">&#41;</span>
&nbsp; &nbsp; number = models.<span class="me1">CharField</span><span class="br0">&#40;</span>max_length=20<span class="br0">&#41;</span>
&nbsp; &nbsp; slug = models.<span class="me1">SlugField</span><span class="br0">&#40;</span>blank=<span class="kw2">True</span><span class="br0">&#41;</span>
&nbsp; &nbsp; <span class="kw1">def</span> <span class="kw4">__unicode__</span><span class="br0">&#40;</span><span class="kw2">self</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> u<span class="st0">'%s #%s'</span> <span class="sy0">%</span> <span class="br0">&#40;</span><span class="kw2">self</span>.<span class="me1">title</span>, <span class="kw2">self</span>.<span class="me1">number</span><span class="br0">&#41;</span>

&nbsp; &nbsp; <span class="co1"># Here is where the code you need starts.</span>
&nbsp; &nbsp; <span class="kw1">def</span> save<span class="br0">&#40;</span><span class="kw2">self</span>, <span class="sy0">*</span>args, <span class="sy0">**</span>kwargs<span class="br0">&#41;</span>:
&nbsp; &nbsp; <span class="co1"># Creates the slug, including the foreign key's slug.</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">self</span>.<span class="me1">slug</span> = <span class="kw2">str</span><span class="br0">&#40;</span><span class="kw2">self</span>.<span class="me1">title</span>.<span class="me1">slug</span><span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Calls the parent save()</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">super</span><span class="br0">&#40;</span>Issue, <span class="kw2">self</span><span class="br0">&#41;</span>.<span class="me1">save</span><span class="br0">&#40;</span><span class="sy0">*</span>args, <span class="sy0">**</span>kwargs<span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Adds the number</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">self</span>.<span class="me1">slug</span> = <span class="kw2">str</span><span class="br0">&#40;</span><span class="kw2">self</span>.<span class="me1">title</span>.<span class="me1">slug</span><span class="br0">&#41;</span> + <span class="st0">'-'</span> + <span class="kw2">str</span><span class="br0">&#40;</span><span class="kw2">self</span>.<span class="me1">number</span><span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Calls the parent save() again</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">super</span><span class="br0">&#40;</span>Issue, <span class="kw2">self</span><span class="br0">&#41;</span>.<span class="me1">save</span><span class="br0">&#40;</span><span class="sy0">*</span>args, <span class="sy0">**</span>kwargs<span class="br0">&#41;</span></div>
</div>
</pre>
<p>So, for example, when you save the Issue model in the Django admin, the slug field generates something like this, <a href="http://comics.emmafrostfiles.com/issues/astonishing-x-men-12/">comics.emmafrostfiles.com/issues/<strong>astonishing-x-men-12</strong></a> &#8211; which, by the way, has one of my favorite variant covers!</p>
<p>I had about 900 issues that needed to be &#8220;slugged.&#8221; Of course, I didn&#8217;t click &#8220;save&#8221; on each issue 900 times &#8211; that would have been too tedious. Login to SSH and save all the objects in the model you need slugged:</p>
<div class="codesnip-container" >&gt;&gt;&gt; from myproject.comics.models import Issue<br />
&gt;&gt;&gt; for issue in Issue.objects.all():<br />
&#8230; issue.save()</div>
<p>I actually ran into a problem that did not throw me an error &#8211; but it was a simple fix. Make sure your character length for the slugs are right. You&#8217;ll have to go into your database admin to edit the length.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeelaplant.com/2012/01/how-to-prepopulate-a-slug-field-from-a-foreign-key-in-django/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hello Family, Hello Friends, and Hello world!</title>
		<link>http://aimeelaplant.com/2012/01/hello-family-hello-friends-hello-world/</link>
		<comments>http://aimeelaplant.com/2012/01/hello-family-hello-friends-hello-world/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 15:55:35 +0000</pubDate>
		<dc:creator>Aimee LaPlant</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://aimeelaplant.com/?p=1</guid>
		<description><![CDATA[Here's to starting my personal blog. I hope the information can be of help to you!]]></description>
			<content:encoded><![CDATA[<p>Saying &#8220;Hello, Hello, Hello&#8221; a bunch of times makes it sound weird. Then again, I tend to run into that weirdness when I say a word too much.</p>
<p>Here&#8217;s to starting my personal blog. I hope the information can be of help to you!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeelaplant.com/2012/01/hello-family-hello-friends-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

