Skip to content

Commit

Permalink
Reapplied the patch of gaebar from http://groups.google.com/group/app…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Lau authored and Ben Lau committed Aug 24, 2009
1 parent 3d3f21d commit bd48640
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions gaebar/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
model_package = modelstuple[0]
model_classes = modelstuple[1]
for model_class in model_classes:
__import__(model_package, globals(), locals(), model_classes)
__import__(model_package, globals(), locals(), str(model_classes))



Expand Down Expand Up @@ -445,10 +445,13 @@ def backup_rows(request):
kind_map = db._kind_map

model_classes = []
current_model_name=""
for model_name in kind_map:
model_classes.append(kind_map[model_name])

Model = kind_map[current_model]
if model_name.rsplit('_', 1)[-1] == current_model.lower() or model_name == current_model.lower():
if current_model_name=="" or kind_map[model_name].all().count(1) >0:
current_model_name = model_name
Model = kind_map[current_model_name]

fields = Model.fields()

Expand Down
6 changes: 3 additions & 3 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@

GAEBAR_SERVERS = {
u'Deployment': u'http://test.gogogo.hk',
# u'Staging': u'http://myappstaging.appspot.com',
u'Local Test': u'http://localhost:8000',
u'Staging': u'http://gogogo-staging.appspot.com',
u'Local Test': u'http://localhost:8080',
}

GAEBAR_MODELS = (
(
'gogogo.models',
('Agency','Stop','Route','Trip','Changelog','Cluster'),
(u'Agency',u'Stop',u'Route',u'Trip',u'Changelog',u'Cluster'),
),
)

Expand Down

0 comments on commit bd48640

Please sign in to comment.