Re: Generating a list of available templates

2012-02-11 Thread bb6xt
Here's my two cents. Hope it helps some. from proj.settings import TEMPLATE_DIRS, INSTALLED_APPS import os def recursive_search(path): result = [] for i in os.listdir(path): if not os.path.isdir(os.path.join(path, i)): result.append(i) else: result.extend(recu

Re: How to come to #anchor After Form Submit with message rendering..

2012-02-26 Thread bb6xt
Hi, You could also pass a variable in the response's dictionary and use javascript to check this variable and navigate appropriately. This variable should indicate if postback or new request. -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: How to come to #anchor After Form Submit with message rendering..

2012-02-26 Thread bb6xt
Hi, You could also pass a variable in the response's dictionary and use javascript to check this variable and navigate appropriately. This variable should indicate if postback or new request. -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: How do you use a link as a post request?

2012-03-05 Thread bb6xt
You can achieved that by using javascript or jquery. But personally I prefer jquery so I'll illustrate with a jquery example. # in your template funcion submitForm(){ $.ajax({ url: "some url", type: "POST", data: $("#myform").serialize(), success: function(){//do magic} }); Submit Note ho

Re: How do you use a link as a post request?

2012-03-05 Thread bb6xt
You're welcome. I missed one detail in my last post. Here is it: On Mar 5, 9:27 pm, leaks wrote: > thanks bb6xt..! I couldn't find an answer so I went with a forms POST > request... Thank you anyway... Will give it a try :) -- You received this message because you are subscrib

RE: Should we have a database independent SQL like language in Django?

2012-10-07 Thread bb6xt
Hi, To add another 50 kobo to Babatunde's, I think another way of go may be to have per-backend translations for all raw queries stored as text files or in the database and a seamless way of instropecting and fetching the correct translation at runtime just like language translations. This could

Re: Create table and load data

2012-10-12 Thread bb6xt
Hi Larry, Do you have PyYAML installed? If not install it first and retry or alternatively you could just serialize your fixture in (my personal favorite) JSON. Cheers! Abraham. -- Sent from my mobile device -- You received this message because you are subscribed to the

RE: Help with Custom model field and custom validation for EmailField()

2012-11-03 Thread bb6xt
Hi, If all u nid is a field whose value is a comma separated list of emails den u dont nid a custom field at all. All u nid is a gud ol CharField. Just set it like so: emails=models.CharField(max_length=500, validators=[multi_email_validator,]). here is what multi_email_validator looks like: from

Loading django templates/static files from pyrcc4 generated resource file

2011-11-24 Thread bb6xt
Hi folks, I am writing a PyQt frontend to a django application. Before calling app.exec_() on the qt app i first start up the django development server on a thread and later on access my views through a QtWebView. Since I use the pyrcc4 generated resource file for my qt app I just think it wou

Django jQuery AJAX Self Replacing Script

2013-01-01 Thread bb6xt
Hi, I am not entirely sure of what you intend but I will suggest you refactor your javascript/jQuery code into 3 named functions, 1 for the original script, the other for the replacement script and the third function should just choose which of the first two functions to use depending on the ID

RE: Django installation on Hostgator

2013-01-04 Thread bb6xt
Hi Gjorge, I haven't used Hostgator but I believe just extracting the required packages into project root should work. Here what am proposing: myproj/ myproj/ django/ django_extensions/ South This way you simply upload your project to the server along with the dependencies. disla

RE: Best/Cleanest way to add fields to Class User in models.py?

2013-01-12 Thread bb6xt
I'll advice you take a look at the custom user models documentation. It is new in django 1.5 which will become the latest stable version in less than 2 weeks from now(?). It looks like the cleanest way imho. Sorry I don't have the link but am sure a simple search will lead you to the django doc