update oxjs params and setUrl, some more user functions

This commit is contained in:
j 2009-10-07 21:43:46 +02:00
parent 4d4d500e4c
commit 0c8906ffbd
5 changed files with 14 additions and 13 deletions

View file

@ -28,7 +28,6 @@ urlpatterns = patterns("oxdb.backend.views",
(r'^archive/(?P<archive>.+)/remove', 'remove_file'),
(r'^file/parse', 'file_parse'),
(r'^subtitle/get', 'subtitles'),
(r'^preferences', 'preferences'),
# Example:
# (r'^oxdata/', include('oxdata.foo.urls')),
@ -40,3 +39,8 @@ urlpatterns = patterns("oxdb.backend.views",
# Uncomment the next line to enable the admin:
# (r'^admin/(.*)', admin.site.root),
)
#add user urls. login, logout, preferences etc
import user_management.urls
urlpatterns += user_management.urls.urlpatterns

View file

@ -5,7 +5,6 @@ import re
from datetime import datetime
from urllib2 import unquote
from django.db import models
from django.db.models import Q, Avg, Count
from django.contrib.auth.models import User
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
@ -14,10 +13,10 @@ from django.core.paginator import Paginator
from django.contrib.auth.decorators import login_required
from django.utils import simplejson as json
from oxdb.utils.shortcuts import render_to_json_response
from oxdb.utils.decorators import login_required_json
import models
import utils
from decorators import login_required_json
'''
field.length -> movie.sort.all()[0].field
@ -359,13 +358,4 @@ def file_parse(request):
response = utils.parsePath(request.POST['path'])
return render_to_json_response(response)
'''
POST preferences/get?key=
POST preferences/set?key=&value
'''
@login_required_json
def preferences(request):
oshash = request.POST['oshash']
return ''

View file

@ -22,6 +22,8 @@ DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
#CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.

View file

@ -727,7 +727,7 @@ $(function() {
sort: user.prefs.sortGroups,
order: user.prefs.orderGroups,
url: "/json/find",
params: ["g=country"]
params: {g:"country"}
}).attr({
id: "groups"
});
@ -1062,6 +1062,11 @@ $(function() {
}).attr({
id: "find"
}).appendTo($topMenu.$element).trigger("blur");
$find.change(function(that) {
var q = $(this).val();
$main.setUrl("/json/find", {q:q});
$mainBrowser.setUrl("/json/find", {g:"country", q:q});
});
/*
$find = $("<input/>")