]> git.decadent.org.uk Git - memories.git/blobdiff - Memories/SystemTag.pm
Ignore quilt's .pc directory
[memories.git] / Memories / SystemTag.pm
index d4f84390665a66ff51adfc2b40c1a7a945723e64..0383db2f8bb60f325e7d29ca43caa45d47cd696a 100644 (file)
@@ -6,10 +6,9 @@ __PACKAGE__->table("system_tag");
 
 Memories::Photo->set_sql(sorted_by_system_tag => q/
 SELECT photo.id as id, title, uploader, uploaded, x, y
-FROM photo, system_tag, system_tagging
+FROM photo, system_tagging
 WHERE system_tagging.photo = photo.id
-    AND system_tagging.tag = system_tag.id
-    AND system_tag.id = ?
+    AND system_tagging.tag = ?
 ORDER BY photo.uploaded DESC
 /
 );
@@ -30,33 +29,10 @@ sub view :Exported {
     $r->{template_args}{tags} = [$tag]; # For selector
     $r->{template_args}{photos} =
         [$pager->search_sorted_by_system_tag($tag->id)];
+    $r->last_search;
 }
 
 package Memories::SystemTagging;
 use base qw(Memories::DBI);
 use Class::DBI::Pager;
-__PACKAGE__->table("system_tagging");
-__PACKAGE__->columns(TEMP => qw/count/);
-__PACKAGE__->columns(Essential => qw/id tag photo/);
-__PACKAGE__->set_sql(summary => qq/
-SELECT  id, system_tag, count(*) AS count
-FROM system_tagging
-GROUP BY system_tag
-ORDER BY count DESC
-LIMIT 50
-    /);
-__PACKAGE__->set_sql(all => qq/
-SELECT  id, tag, count(*) AS count
-FROM system_tagging
-GROUP BY system_tag
-ORDER BY count DESC
-    /);
-Memories::SystemTagging->has_a("photo" => "Memories::Photo");
-Memories::SystemTagging->has_a("tag" => "Memories::SystemTag");
-
-Memories::Photo->has_many(system_tags => ["Memories::SystemTagging" => "system_tag"]);
-Memories::Photo->has_many(system_taggings => "Memories::SystemTagging");
-Memories::SystemTag->has_many(photos => ["Memories::SystemTagging" => "photo"] );
-Memories::SystemTag->has_many(system_taggings => "Memories::SystemTagging");
-
 1;