 	,birthdaymonth=11
 	,birthdayyear=1973
 	,isactive=1
-);
-
-db.per = model("author").create(firstName="Per", lastName="Djurner");
-db.per.createProfile(dateOfBirth="20/02/1975", bio="ColdFusion Developer");
-db.per.createPost(title="Title for first test post", body="Text for first test post", views=5);
-db.per.createPost(title="Title for second test post", body="Text for second test post", views=5, averageRating="3.6");
-db.per.createPost(title="Title for third test post", body="Text for third test post", averageRating="3.2");
-db.tony = model("author").create(firstName="Tony", lastName="Petruzzi");
-db.tony.createPost(title="Title for fourth test post", body="Text for fourth test post", views=3, averageRating="3.6");
-db.tony.createPost(title="Title for fifth test post", body="Text for fifth test post", views=2, averageRating="3.6");
-db.chris = model("author").create(firstName="Chris", lastName="Peters");
-db.peter = model("author").create(firstName="Peter", lastName="Amiri");
-db.james = model("author").create(firstName="James", lastName="Gibson");
-db.raul = model("author").create(firstName="Raul", lastName="Riera");
-db.andy = model("author").create(firstName="Andy", lastName="Bellenie");
-db.users = model("user").findAll(order="id");
-
-for (db.user in db.users) {
-	for (db.i in [1,2,3,4,5]) {
-		db.gallery = model("gallery").create(
-			userid="#db.user.id#"
-			,title="#db.user.firstname# Test Galllery #db.i#"
-			,description="test gallery #db.i# for #db.user.firstname#"
-		);
-		for (db.j in [1,2,3,4,5,6,7,8,9,10]) {
-			db.photo = model("photo").create(
-				galleryid="#db.gallery.id#"
-				,filename="Gallery #db.gallery.id# Photo Test #db.j#"
-				,description1="test photo #db.j# for gallery #db.gallery.id#"
-			);
-		};
-	};
-};
-
-model("user2").create(username="Chris", password="x", firstName="x", lastName="x");
-model("user2").create(username="Tim", password="x", firstName="x", lastName="x");
-model("user2").create(username="Tom", password="x", firstName="x", lastName="x");
-// create a profile with an author
-model("profile").create(dateOfBirth="1/1/1970", bio="Unknown Author");
-
-db.posts = model("post").findAll(order="id");
-for (db.post in db.posts) {
-	for (db.i in [1,2,3]) {
-		db.comment = model("comment").create(
-			postid=db.post.id
-			,body="This is comment #db.i#"
-			,name="some commenter #db.i#"
-			,url="http://#db.i#.somecommenter.com"
-			,email="#db.i#@#db.i#.com"
-		);
-	};
-};
-
-// cities and shops
-for (db.i in [1,2,3,4,5]) {
-	model("city").create(id=3, citycode=db.i, name="county #db.i#");
-	model("shop").create(shopid="shop#db.i#", citycode=db.i, name="shop #db.i#");
-};
-model("shop").create(shopid=" shop6", citycode=0, name="x");
-
-// tags
-db.releases = model("tag").create(name="releases",description="testdesc");
-model("tag").create(name="minor", description="a minor release", parentid=3);
-model("tag").create(name="major", description="a major release");
-model("tag").create(name="point", description="a point release", parentid=2);
-
-db.fruit = model("tag").create(name="fruit", description="something to eat");
-model("tag").create(name="apple", description="ummmmmm good", parentid=db.fruit.id);
-model("tag").create(name="pear", description="rhymes with Per", parentid=db.fruit.id);
-model("tag").create(name="banana", description="peel it", parentid=db.fruit.id);
-
-// classifications
-model("classification").create(postid=1, tagid=7);
-
-// collisiontests
-model("collisiontest").create(method="test");
-for (db.i in [1,2,3,4,5]) {
-	for (db.a in [1,2,3,4,5]) {
-		model("CombiKey").create(id1=db.i, id2=db.a, userId=db.a);
-	};
-};
-
-// sqltype
-model("sqltype").create(stringVariableType="tony", textType="blah blah blah blah");
-
-// assign posts for multiple join test
-db.andy.update(favouritePostId=1, leastFavouritePostId=2);
-</cfscript>
+)>
+
+<cfset loc.per = model("author").create(firstName="Per", lastName="Djurner")>
+<cfset loc.per.createProfile(dateOfBirth="20/02/1975", bio="ColdFusion Developer")>
+<cfset loc.per.createPost(title="Title for first test post", body="Text for first test post", views=5)>
+<cfset loc.per.createPost(title="Title for second test post", body="Text for second test post", views=5, averageRating="3.6")>
+<cfset loc.per.createPost(title="Title for third test post", body="Text for third test post", averageRating="3.2")>
+<cfset loc.tony = model("author").create(firstName="Tony", lastName="Petruzzi")>
+<cfset loc.tony.createPost(title="Title for fourth test post", body="Text for fourth test post", views=3, averageRating="3.6")>
+<cfset loc.tony.createPost(title="Title for fifth test post", body="Text for fifth test post", views=2, averageRating="3.6")>
+<cfset loc.chris = model("author").create(firstName="Chris", lastName="Peters")>
+<cfset loc.peter = model("author").create(firstName="Peter", lastName="Amiri")>
+<cfset loc.james = model("author").create(firstName="James", lastName="Gibson")>
+<cfset loc.raul = model("author").create(firstName="Raul", lastName="Riera")>
+<cfset loc.andy = model("author").create(firstName="Andy", lastName="Bellenie")>
+
+<cfset loc.users = model("user").findAll(order="id")>
+
+<cfloop query="loc.users">
+	<cfloop from="1" to="5" index="loc.i">
+		<cfset loc.gallery = model("gallery").create(
+			userid="#loc.users.id#"
+			,title="#loc.users.firstname# Test Galllery #loc.i#"
+			,description="test gallery #loc.i# for #loc.users.firstname#"
+		)>
+
+		<cfloop from="1" to="10" index="loc.i2">
+			<cfset loc.photo = model("photo").create(
+				galleryid="#loc.gallery.id#"
+				,filename="Gallery #loc.gallery.id# Photo Test #loc.i2#"
+				,description1="test photo #loc.i2# for gallery #loc.gallery.id#"
+			)>
+		</cfloop>
+	</cfloop>
+</cfloop>
+
+<cfset model("user2").create(username="Chris", password="x", firstName="x", lastName="x")>
+<cfset model("user2").create(username="Tim", password="x", firstName="x", lastName="x")>
+<cfset model("user2").create(username="Tom", password="x", firstName="x", lastName="x")>
+
+<!--- create a profile with an author --->
+<cfset model("profile").create(dateOfBirth="1/1/1970", bio="Unknown Author")>
+
+<cfset loc.posts = model("post").findAll(order="id")>
+
+<cfloop query="loc.posts">
+	<cfloop from="1" to="3" index="loc.i">
+		<cfset loc.comment = model("comment").create(
+			postid=loc.posts.id
+			,body="This is comment #loc.i#"
+			,name="some commenter #loc.i#"
+			, url="http://#loc.i#.somecommenter.com"
+			, email="#loc.i#@#loc.i#.com"
+		)>
+	</cfloop>
+</cfloop>
+
+<!--- cities and shops --->
+<cfloop from="1" to="5" index="loc.i">
+	<cfset model("city").create(
+		id="3"
+		,citycode="#loc.i#"
+		,name="county #loc.i#"
+	)>
+
+	<cfset model("shop").create(
+		shopid="shop#loc.i#"
+		,citycode="#loc.i#"
+		,name="shop #loc.i#"
+	)>
+</cfloop>
+
+<cfset model("shop").create(shopid=" shop6", citycode=0, name="x")>
+
+<!--- tags --->
+<cfset loc.releases = model("tag").create(name="releases",description="testdesc")>
+<cfset model("tag").create(name="minor",description="a minor release", parentid=3)>
+<cfset model("tag").create(name="major",description="a major release")>
+<cfset model("tag").create(name="point",description="a point release", parentid=2)>
+
+<cfset loc.fruit = model("tag").create(name="fruit",description="something to eat")>
+<cfset model("tag").create(name="apple",description="ummmmmm good", parentid=loc.fruit.id)>
+<cfset model("tag").create(name="pear",description="rhymes with Per", parentid=loc.fruit.id)>
+<cfset model("tag").create(name="banana",description="peal it", parentid=loc.fruit.id)>
+
+<!--- classifications --->
+<cfset model("classification").create(postid=1,tagid=7)>
+
+<!--- collisiontests --->
+<cfset model("collisiontest").create(
+	method="test"
+)>
+
+<!--- collisiontests --->
+<cfloop from="1" to="5" index="i">
+	<cfloop from="1" to="5" index="a">
+		<cfset model("CombiKey").create(
+			id1="#i#",
+			id2="#a#",
+			userId="#a#"
+		)>
+	</cfloop>
+</cfloop>
+
+<!--- sqltype --->
+<cfset model("sqltype").create(
+	stringVariableType="tony"
+	,textType="blah blah blah blah"
+)>
+
+<!--- assign posts for multiple join test --->
+<cfset loc.andy.update(favouritePostId=1, leastFavouritePostId=2)>

	,birthdaymonth=11
	,birthdayyear=1975
	,isactive=1
);
db.user = model("user").create(
	username='chrisp'
	,password='chrisp123'
	,firstname='Chris'

	,birthdaymonth=10
	,birthdayyear=1972
	,isactive=1
)>

<cfset loc.user = model("user").create(
	username='perd'
	,password='perd123'
	,firstname='Per'
