tagging works
[zzz-floof.git] / floof / lib / dbhelpers.py
diff --git a/floof/lib/dbhelpers.py b/floof/lib/dbhelpers.py
new file mode 100644 (file)
index 0000000..4d10030
--- /dev/null
@@ -0,0 +1,5 @@
+def find_or_create(model, **kwargs):
+    instance = model.get_by(**kwargs)
+    if not instance:
+        instance = model(**kwargs)
+    return instance
\ No newline at end of file