Re: django 1.3 timing out on empty POST request

2011-06-27 Thread Roberto De Ioris

Il giorno 27/giu/2011, alle ore 22.07, mehdi ait oufkir ha scritto:

> Roberto, I'm actually using uWSGI 0.9.6.5.
> 
> Can you tell me what is the issue with the previous version. I can
> stop by on uwsgi IRC if you want to take the conversation off google's
> groups.
> 
> -mehdi


Versions < 0.9.8 expect a fully compliant (read: very simple) WSGI behaviour.

Actually the world is a bit more complex than this so in 0.9.8 i added a more 
"tolerant"
wsgi.input object. (pratically it is the same technic of mod_wsgi for apache 
with some addition)

Upgrading to 0.9.8.1 can bypass the issue or eventually throw an error pointing 
to what it is wrong
in django code. 



> 
> On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
>>> Roberto,
>> 
>>> it is uWSGI, but can you explain a bit more what the post-buffering
>>> would help me do?
>>> Would it help me debug with pdb?
>>> -mehdi
>> 
>> Before starting a pretty long and boring explanation, can you double check
>> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
>> in a safer way avoiding blocking calls.
>> 
>> --
>> Roberto De Iorishttp://unbit.it
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

--
Roberto De Ioris
http://unbit.it

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



giving download links

2011-06-27 Thread raj
I allow a user to upload a file, how do I now allow them to download
this file? I looked at the "serving static files" thing in the
djangoproject, but they said it causes security flaws or something.
Can someone help me? I couldn't find good information on google. Thank
you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: upload file isn't working

2011-06-27 Thread raj
How do you view the debugger? I am using webfaction hosting.
Otherwise, does the code look fine?

On Jun 27, 5:48 am, Malcolm Box  wrote:
> On 24 June 2011 17:36, raj  wrote:
>
>
>
>
>
>
>
>
>
> > 
> > def upload_view(request):
> >    user = request.user
> >    if user.is_authenticated():
> >        if request.method == 'POST':
> >            form =upload_form(request.POST, request.FILES, user)
> >            if form.is_valid():
> >                file_instance = upload_model()
> >                saved_file = handle_uploads(request, ['doc'])
> > #request.POST.get('title'))
> >                for f in saved_file:
> >                    setattr(file_instance, f[0])
> >                file_instance.save()
> >                return HttpResponseRedirect('/user/update/success/')
> >        else:
> >            form = upload_form()
> >    return render_to_response('/home/oneadmin/webapps/oneadmin/
> > oneadmin/templates/oneadmissions/documents.html', {'form':form},
> > context_instance = RequestContext(request))
>
> > my urls.py file has a url that links to the upload_view. I just cant
> > seem to find why the file isn't uploading. Whenever I try to upload
> > something, it just refreshes the page and states that the given fields
> > are required (even though I entered all the information). Help please.
>
> It looks to me like form.is_valid() is returning False, so you're seeing the
> error messages.
> You can debug the cause by putting
>
> import pdb;pdb.set_trace()
>
> just above the "if form.is_valid():" line and then stepping through the
> validation code in the debugger.
>
> Malcolm

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to add CSRF to context when using test client???

2011-06-27 Thread andres ledesma
Hi Matteius, I stumbled across the same problem.
I wanted to carry out a test case using CSRF, and I failed.
I managed to add the csrf_token to my post request, but
apparently this is not enough. Here I will show you the code,
perhaps you will have better luck then...

c = Client(enforce_csrf_checks=True)
response = c.get('/auction/add/') # get a fresh form
print(response.content) # just to have a look
csrf_token = response.context['csrf_token'] # get the token
print('the token is: %s' % csrf_token) # show me the token

# now, we add the token value to the key csrfmiddlewaretoken
# as this is where django CSRF will check it

post_data = {
'csrfmiddlewaretoken': csrf_token,
'item': 'test item',
'price': '154.78',
'end_date': '2011-08-05 19:30:00',
}
# now we can send the post
response = c.post('/auction/add/', post_data)
# now we test the assert
self.assertEqual(response.status_code, 200)

As I said, this still does not work, I get a 403: which refers
to an invalid CSRF token key. If you managed to overcome this
problem, please let us know. So far, I decided
not to use c = Client(enforce_csrf_checks=True) but this is not
a nice solution, is it?
Best!
-Andres

On Jun 10, 8:02 pm, Matteius  wrote:
> Yes I Have this in the setUp function which causes my POST request to
> get a 403 forbidden because I don't actually include the CSRF field in
> the context as the middleware does on a deployed version of the site.
> I need a function to call or something to get the CSRF context value,
> or a function that I can pass a context which will add it in the
> CSRF.  Otherwise there is not much of a point to enable CSRF with the
> test client because you'll get 403 errors.
>
> -Matt
>
> On Jun 10, 1:46 am, Artemenko Alexander  wrote:
>
>
>
>
>
>
>
> > Hi Matt,
>
> > Use:
>
> > from django.test import Client
> > csrf_client = Client(enforce_csrf_checks=True)
>
> >https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#testing
>
> > 10.06.2011, 08:48, "Matteius" :
>
> > > Greetings,
>
> > > I am writing unit tests for my application, and I want to leave CSRF
> > > checks enabled in testing. This means on my POST I am getting 403
> > > because I have not figured out how to add csrf to my context when
> > > using the test client. Please advise on how to most easily do this:
>
> > > # Issue a POST request.
> > > response = self.client.post('/student/open_enrollments/',
> > > {'course': 3})
> > > # Check that the response is 200 OK.
> > > self.assertEqual(response.status_code, 200)
> > > # Verify template is the expected one.
> > > self.assertTemplateUsed(response, 'student_portal/
> > > open_enrollments.html')
> > > # Check that the rendered context contains now 0 Courses.
> > > self.assertEqual(len(response.context['courses']), 0)
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Call SQL function within Model

2011-06-27 Thread Naoko Reeves
Dear Experts,
I am using postgresql and have field type bytea.
This is an encrypted field
I normally decrypt value with sql function.
I would like to use this function to return value from Django model.
Is this possible? If so could you guide me how could I accomplish this?

Thank you very much for your time in advance.
Naoko

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question about Displaying a Table

2011-06-27 Thread bruno desthuilliers
On Jun 27, 8:18 pm, Kyle Latham  wrote:
> Hello,
>
> I am pretty new to Django and Python.

Then I strongly suggest you take some time learning Python. I mean,
pure Python, without Django.

> I'm wanting to create a Django app that displays different tables in
> my MySQL database, and the user can search through the tables for info
> they want.
>
> I haven't written any code yet,

Uhuh...

> I'm doing research on the approach I
> have to take.

Knowledge comes from experience, and experience comes from practice.
Until you get some hands-on experience with both Python and Django,
your "research" is mostly a waste of time. FWIW, Django is pretty well
documented, and if you

1/ have some working experience with web programming (say, raw PHP /
MySQL, or CGI, or whatever) and
2/ do the tutorial

then you should know enough to start writing your app. Possibly not
the best way, but it still should work, and you'll learn how to
rewrite your app in better way in the process.

> Is the only way I am able to display a table from the
> MySQL database in Django by creating a template and importing the data
> to the template?

You don't even need a template - you can build the response content
how you see fit. Templates are just handy for most text (including
HTML) formatting, but that's all. And you (usually) don't "import data
to the template", you *pass* data (well, actually, python objects,
which is not quite the same thing) to the template, render it and
build a response from the result.


> Is there a another/better approach towards displaying
> a MySQL table in the Django app?

Django is not server page, it's a Model/Presentation framework. The
request/response cycle goes like:

1/ the framework finds an view matching the url pattern
2/ it calls the view with the request and possibly a couple arguments
computed from the url and the pattern
3/ the view returns a response

And that's it. The templating system is just here to help you
formatting your response's body.

Ok, it's half truth and half lie - using custom tags and context
processors you can do much more than "formatting data" with Django's
template system -, but still, Django is NOTHING like server page
systems (PHP, ASP 1.x etc), and the very core of Django is url
patterns matching, views, requests and responses. If you hope to make
the best use of Django, first learn to do things the Django way
instead of fighting against it. Trying to write PHP / ASP / whatever
server page system in Django will  be at best a very frustrating
experience.

This being said: template-driven code is *sometimes* just the
RightThing to do, and this is something you can indeed do in Django
(if you know how to) - but I don't think it's how you will better
solve your problem. FWIW, Django already has some support foer very
generic "table display / filter / search" features in the admin app,
and this is NOT template-driven code (but it's OSS so you can read the
source - but beware, serious Python knowledge required).

HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ModelAdmin, custom field: default value?

2011-06-27 Thread momo2k
Hello,

Is there a way to set dynamic default values for custom fields in the
admin?

Description of the problem:

# models.py
# there are two models
class Meal(models.Model):
name = ...

def check_new_price(self, price):
# checks if the price is new and creates a new price if
neccessary

class Price(models.Model):
meal = models.ForeignKey(Meal, )
valid_to = models.DateField() # None for current price
amount = CurrencyField() # nearly identical to IntegerField

# admin.py
# I extended the Admin with a custom form:
class MealModelForm(forms.ModelForm):
price = CurrencyFormField() # Nearly identical to Decimalfield
class Meta:
model = Meal

class MealAdmin(admin.ModelAdmin):
form = MealModelForm

def save_model(self, request, obj, form, change):
super(MealAdmin, self).save_model(request, obj, form, change)
obj.check_new_price(form.cleaned_data['price'])


My question is: How do i tell the django admin to display the current
price in the form field? I already tried to add an "price"-attribute
in the ModelAdmin.get_object() method, but that doesn't work. If I
call the Admin page for a meal, the price is blank instead of
displaying the current price.

So, repeating my first question: Is there a way to set dynamic default
values for custom fields in the admin?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: REMOTE_USER authentication to 'Admin'?

2011-06-27 Thread Jeff Blaine
Sorry, I have no knowledge of Oracle SSO, what it allows, how it works, etc.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/kFeKEvDSqZYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.3 timing out on empty POST request

2011-06-27 Thread mehdi ait oufkir
(not sure if my previous message went through).

Roberto,

I'm using uWSGI 0.9.6.5. Can you tell me a bit more about the issue?
and why this is happening only with 1.3.

We can take the conversation of google group if you want. I can join
the #uwsgi irc.

Please let me know,
-mehdi

On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
> > Roberto,
>
> > it is uWSGI, but can you explain a bit more what the post-buffering
> > would help me do?
> > Would it help me debug with pdb?
> > -mehdi
>
> Before starting a pretty long and boring explanation, can you double check
> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
> in a safer way avoiding blocking calls.
>
> --
> Roberto De Iorishttp://unbit.it

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django 1.3 timing out on empty POST request

2011-06-27 Thread mehdi ait oufkir
Roberto, I'm actually using uWSGI 0.9.6.5.

Can you tell me what is the issue with the previous version. I can
stop by on uwsgi IRC if you want to take the conversation off google's
groups.

-mehdi

On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
> > Roberto,
>
> > it is uWSGI, but can you explain a bit more what the post-buffering
> > would help me do?
> > Would it help me debug with pdb?
> > -mehdi
>
> Before starting a pretty long and boring explanation, can you double check
> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
> in a safer way avoiding blocking calls.
>
> --
> Roberto De Iorishttp://unbit.it

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: REMOTE_USER authentication to 'Admin'?

2011-06-27 Thread thiru
Hi

I have a problem in my application, we are implementing oracle single
sign on to our existing django application, I managed to implement SSO
for the application, but I can able use the same information to login
into Django admin.

I like to know how to use the SSO login User information to log into
django admin.

Regards
Thiru

On May 20, 8:38 am, Jeff Blaine  wrote:
> Thanks Jacob and Ramiro.
>
> I finally figured it out, and unfortunately it was, of course, something
> stupid :(
>
> I had changed the directory name holding my WSGI app and had not changed the
> Apache config's path reference in *both* places (ScriptAlias and
> Directory).  SIGH.
> That was causing the static file requests to show up in access_log as from
> 'jblaine',
> which made me think all auth was working properly, when in fact it wasn't.
>  It just
> took me to finally notice that there were requests from '-' and 'jblaine' in
> the same
> session full of requests.  I'm a little surprised I even noticed finally.
>
> Additionally, as Jacob pointed out, I needed my own configure_user to
> set default permissions to get any login access to Admin for auto-created
> users.
>
> Sweet:
>
> [Thu May 19 23:31:36 2011] [error] in MyRemoteUserBackend.authenticate()
> [Thu May 19 23:31:36 2011] [error] Remote user is jblaine
> [Thu May 19 23:31:36 2011] [error] Remote user cleaned is jblaine
> [Thu May 19 23:31:36 2011] [error] Trying to create jblaine
> [Thu May 19 23:31:36 2011] [error] Created jblaine
> [Thu May 19 23:31:36 2011] [error] in MyRemoteUserBackend.configure_user()
> [Thu May 19 23:31:37 2011] [error] Set jblaine is_staff and is_superuser
> True
>
> Now I have the problem where "Logout" from Admin actually does not do
> much of anything because REMOTE_USER is still set in the browser and all
> someone has to do is revisit /admin with the same browser instance and they
> get automatically logged right back in without a password.
>
> But I'll take that after this victory.  Thanks Jacob and Ramiro!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



SSO User Login to Django Admin Page

2011-06-27 Thread thiru
Hi Friends

I have a problem in my application, we are implementing oracle single
sign on to our existing django application, I managed to implement SSO
for the application, but I can able use the same information to login
into Django admin.

I like to know how to use the SSO login User information to log into
django admin.

Regards
Thiru

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Model Designer - UML

2011-06-27 Thread Sushirod
I'll try the SQLeditor, thanks for the input.

But I like navicat very much.
http://www.navicat.com/

And the free heidiSQL for windows platform.
http://www.heidisql.com/

On 26 jun, 09:24, Mateusz Harasymczuk  wrote:
> I found perfect tool for mac
> SQLeditor + Django plugin
>
> works perfect!
>
> http://www.malcolmhardie.com/sqleditor/django/index.html
>
> --
> Matt Harasymczukhttp://www.matt.harasymczuk.pl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question about Displaying a Table

2011-06-27 Thread Steven Elliott Jr
Django has about the best documentation out there foe getting started. Walk 
through the tutorial and see how it goes. 

Sent from my iPhone

On Jun 27, 2011, at 2:25 PM, "Cal Leeming [Simplicity Media 
Ltd]" wrote:

> Forgive me but, the tone of this email sounds like you are asking us to do 
> this research for you :X
> 
> On Mon, Jun 27, 2011 at 7:18 PM, Kyle Latham  wrote:
> Hello,
> 
> I am pretty new to Django and Python.
> 
> I'm wanting to create a Django app that displays different tables in
> my MySQL database, and the user can search through the tables for info
> they want.
> 
> I haven't written any code yet, I'm doing research on the approach I
> have to take.  Is the only way I am able to display a table from the
> MySQL database in Django by creating a template and importing the data
> to the template? Is there a another/better approach towards displaying
> a MySQL table in the Django app?
> 
> Thank you,
> 
> Kyle
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question about Displaying a Table

2011-06-27 Thread Cal Leeming [Simplicity Media Ltd]
Forgive me but, the tone of this email sounds like you are asking us to do
this research for you :X

On Mon, Jun 27, 2011 at 7:18 PM, Kyle Latham  wrote:

> Hello,
>
> I am pretty new to Django and Python.
>
> I'm wanting to create a Django app that displays different tables in
> my MySQL database, and the user can search through the tables for info
> they want.
>
> I haven't written any code yet, I'm doing research on the approach I
> have to take.  Is the only way I am able to display a table from the
> MySQL database in Django by creating a template and importing the data
> to the template? Is there a another/better approach towards displaying
> a MySQL table in the Django app?
>
> Thank you,
>
> Kyle
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread Cal Leeming [Simplicity Media Ltd]
+1 on this, Bruno explained it better than my first email.

On Mon, Jun 27, 2011 at 7:22 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On Jun 27, 12:30 pm, Coulson Thabo Kgathi  wrote:
> > ok
> >
> > #models.py file
> >
> > from django.db import models
> > from django.forms import ModelForm
> > from django import forms
> > from choices import YESNO, AGE, OPTIONS1, OPTIONS2, OPTIONS3, OPTIONS4,
> > OPTIONS5, OPTIONS6, OPTIONS7, OPTIONS8, OPTIONS9, OPTIONS10, OPTIONS11,
> > OPTIONS14, OPTIONS15, OPTIONS16, OPTIONS17, OPTIONS18, OPTIONS19
> >
> > class Questxs(models.Model):
> >
> > quest1 = models.CharField(
> > verbose_name = '1. Have you ever had sexual intercourse?',
> > blank = False,
> > choices = YESNO,
> > max_length = 5,
> > )
> >
> > quest2 = models.CharField(
> > verbose_name = '2. At what age did you begin sexual
> intercuorse?',
> > blank = False,
> > choices = AGE,
> > max_length = 5,
> > null = True,
> > )
> >
> > quest3 =models.CharField(
> > verbose_name = '3. When was the last time you had sexual
> > intercourse?',
> > blank = False,
> > choices = OPTIONS1,
> > max_length = 25,
> > null=True
> > )
> (snip)
>
> OMG :(
>
> Ok, you firts have to learn what a *relational* database is all
> about.  The poll tutorial migh be a good starting point : a "poll" is
> a question with a set of possible answers, and your "questionnaire" is
> a set of questions with each a set of possible answers (do you notice
> some pattern here ?)
>
> You model should look something  like this:
>
> class Questionnaire(models.Model):
>title = models.CharField(verbose_name="Title", max_length=50)
>description = models.TextField(verbose_name="Description",
> blank=True, default="")
>date_created = models.DateTimeField(auto_now_add=True)
>
> class Question(models.Model):
>questionnaire = models.ForeignKey(Questionnaire)
>question = models.CharField(verbose_name="Question",
> max_length="255")
>help = models.TextField(verbose_name="Help", blank=True,
> default="")
>
> class Choice(models.Model):
>question = models.ForeignKey(Question)
>text = model.CharField(verbose_name="Text", max_length="255")
>
> class Answer(models.Model):
>user = models.ForeignKey(User) # or IP address or any other
> session identifier
>choice = models.ForeignKey(Question)
>
>
> Notice how I didn't hard-code anything. All questionnaires /
> questions / choices / answers are stored in the database, which means
> you can create has many different questionnaires as you want without
> having to write a single line of code.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread bruno desthuilliers
On Jun 27, 12:30 pm, Coulson Thabo Kgathi  wrote:
> ok
>
> #models.py file
>
> from django.db import models
> from django.forms import ModelForm
> from django import forms
> from choices import YESNO, AGE, OPTIONS1, OPTIONS2, OPTIONS3, OPTIONS4,
> OPTIONS5, OPTIONS6, OPTIONS7, OPTIONS8, OPTIONS9, OPTIONS10, OPTIONS11,
> OPTIONS14, OPTIONS15, OPTIONS16, OPTIONS17, OPTIONS18, OPTIONS19
>
> class Questxs(models.Model):
>
>     quest1 = models.CharField(
>         verbose_name = '1. Have you ever had sexual intercourse?',
>         blank = False,
>         choices = YESNO,
>         max_length = 5,
>     )
>
>     quest2 = models.CharField(
>         verbose_name = '2. At what age did you begin sexual intercuorse?',
>         blank = False,
>         choices = AGE,
>         max_length = 5,
>         null = True,
>     )
>
>     quest3 =models.CharField(
>         verbose_name = '3. When was the last time you had sexual
> intercourse?',
>         blank = False,
>         choices = OPTIONS1,
>         max_length = 25,
>         null=True
>     )
(snip)

OMG :(

Ok, you firts have to learn what a *relational* database is all
about.  The poll tutorial migh be a good starting point : a "poll" is
a question with a set of possible answers, and your "questionnaire" is
a set of questions with each a set of possible answers (do you notice
some pattern here ?)

You model should look something  like this:

class Questionnaire(models.Model):
title = models.CharField(verbose_name="Title", max_length=50)
description = models.TextField(verbose_name="Description",
blank=True, default="")
date_created = models.DateTimeField(auto_now_add=True)

class Question(models.Model):
questionnaire = models.ForeignKey(Questionnaire)
question = models.CharField(verbose_name="Question",
max_length="255")
help = models.TextField(verbose_name="Help", blank=True,
default="")

class Choice(models.Model):
question = models.ForeignKey(Question)
text = model.CharField(verbose_name="Text", max_length="255")

class Answer(models.Model):
user = models.ForeignKey(User) # or IP address or any other
session identifier
choice = models.ForeignKey(Question)


Notice how I didn't hard-code anything. All questionnaires /
questions / choices / answers are stored in the database, which means
you can create has many different questionnaires as you want without
having to write a single line of code.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question about Displaying a Table

2011-06-27 Thread Ovnicraft
On Mon, Jun 27, 2011 at 1:18 PM, Kyle Latham  wrote:

> Hello,
>
> I am pretty new to Django and Python.
>
> I'm wanting to create a Django app that displays different tables in
> my MySQL database, and the user can search through the tables for info
> they want.
>
> I haven't written any code yet, I'm doing research on the approach I
> have to take.  Is the only way I am able to display a table from the
> MySQL database in Django by creating a template and importing the data
> to the template? Is there a another/better approach towards displaying
> a MySQL table in the Django app?
>

You can research about pagination and template system in django.

Regards,


>
> Thank you,
>
> Kyle
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Cristian Salamea
@ovnicraft

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Question about Displaying a Table

2011-06-27 Thread Kyle Latham
Hello,

I am pretty new to Django and Python.

I'm wanting to create a Django app that displays different tables in
my MySQL database, and the user can search through the tables for info
they want.

I haven't written any code yet, I'm doing research on the approach I
have to take.  Is the only way I am able to display a table from the
MySQL database in Django by creating a template and importing the data
to the template? Is there a another/better approach towards displaying
a MySQL table in the Django app?

Thank you,

Kyle

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
And I think pretty much any webserver can do that.

But now, how to do that in development when using built-in runserver
command?

On Jun 27, 5:33 pm, Mick  wrote:
> Nginx can test to see if a file is available, and if it exist load that 
> instead of proxying the request to django.
>
> location / {
> alias /var/www/static/;
> if (!-f $request_filename) {
> proxy_passhttp://127.0.0.1:8000;
>
> }
> }
>
> Now if /var/www/static/foo.js exists, but /var/www/static/bar.js does not 
> foo.js will be served as a static file by nginx and the bar.js request will 
> be passed to django where you can use a template to dynamically serve it.
>
> Mick
>
>
>
>
>
>
>
> On Monday, June 27, 2011 at 8:23 AM, Jani Tiainen wrote:
> > Apparently I didn't made myself clear enough.
>
> > So let me clarify:
>
> > I have two files that must be accessed using following urls:
>
> > /myapp/views/foo.js
> > /myapp/views/bar.js
>
> > foo.js is a static file and can (and should) be served by using static
> > serving, like webserver.
>
> > bar.js instead is a file that contains django template directives and
> > must be served through django template rendering mechanism.
>
> > On Jun 27, 5:14 pm, Shawn Milochik  wrote:
> > > This can (and probably should) be handled by your Web server.
>
> > > For example, in nginx you may be serving the Django app with something
> > > like this:
>
> > > location / {
> > > proxy_passhttp://127.0.0.1:8400;
> > > }
>
> > > And for static content nginx may direct the request elsewhere. This
> > > example directs
> > > any requests ending in '.html' to a static folder.
>
> > > location ~ ^/.*\.html{
> > > root /var/www/my_static_content;
> > > }
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Mick
Nginx can test to see if a file is available, and if it exist load that instead 
of proxying the request to django.


location / {
alias /var/www/static/;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:8000;
}
}


Now if /var/www/static/foo.js exists, but /var/www/static/bar.js does not 
foo.js will be served as a static file by nginx and the bar.js request will be 
passed to django where you can use a template to dynamically serve it.


Mick
On Monday, June 27, 2011 at 8:23 AM, Jani Tiainen wrote: 
> Apparently I didn't made myself clear enough.
> 
> So let me clarify:
> 
> I have two files that must be accessed using following urls:
> 
> /myapp/views/foo.js
> /myapp/views/bar.js
> 
> foo.js is a static file and can (and should) be served by using static
> serving, like webserver.
> 
> bar.js instead is a file that contains django template directives and
> must be served through django template rendering mechanism.
> 
> On Jun 27, 5:14 pm, Shawn Milochik  wrote:
> > This can (and probably should) be handled by your Web server.
> > 
> > For example, in nginx you may be serving the Django app with something
> > like this:
> > 
> > location / {
> > proxy_passhttp://127.0.0.1:8400;
> > }
> > 
> > And for static content nginx may direct the request elsewhere. This
> > example directs
> > any requests ending in '.html' to a static folder.
> > 
> > location ~ ^/.*\.html{
> > root /var/www/my_static_content;
> > }
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
Apparently I didn't made myself clear enough.

So let me clarify:

I have two files that must be accessed using following urls:

/myapp/views/foo.js
/myapp/views/bar.js

foo.js is a static file and can (and should) be served by using static
serving, like webserver.

bar.js instead is a file that contains django template directives and
must be served through django template rendering mechanism.

On Jun 27, 5:14 pm, Shawn Milochik  wrote:
> This can (and probably should) be handled by your Web server.
>
> For example, in nginx you may be serving the Django app with something
> like this:
>
>      location / {
>          proxy_passhttp://127.0.0.1:8400;
>      }
>
> And for static content nginx may direct the request elsewhere. This
> example directs
> any requests ending in '.html' to a static folder.
>
>      location ~ ^/.*\.html{
>          root /var/www/my_static_content;
>      }

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Shawn Milochik

This can (and probably should) be handled by your Web server.

For example, in nginx you may be serving the Django app with something 
like this:


location / {
proxy_pass http://127.0.0.1:8400;
}

And for static content nginx may direct the request elsewhere. This 
example directs

any requests ending in '.html' to a static folder.

location ~ ^/.*\.html{
root /var/www/my_static_content;
}

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: loading a typical image to Django 1.3

2011-06-27 Thread vahidR
Here it is :

"... importing other libs"

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

".URLs "

urlpatterns += staticfiles_urlpatterns()



On Jun 26, 8:38 pm, Kenny Meyer  wrote:
> What about your urls.py?
>
> Kenny
>
>
>
>
>
>
>
> On Sun, Jun 26, 2011 at 1:15 PM, vahidR  wrote:
> > Hi There,
>
> > I have a very basic question about adding images to Django 1.3.
> > I've almost read the whole documents on adding Static files , searched
> > for relevant results both in here and StackOverFlow and still have a
> > problem with my case.
>
> > Please take a look at my settings :
>
> > STATIC_ROOT = '/home/vahid/Aptana3Workspace/djangoshop/djangoShop/
> > static'
>
> > STATIC_URL = '/static/'
>
> > STATICFILES_DIRS = (STATIC_ROOT ,  )
>
> > I did the last one to avoid collision between ROOT and DIRS and make
> > it more simple to implement the idea.
>
> > I have also added some stuff to settings.py as :
>
> > STATICFILES_FINDERS = (
> >   'django.contrib.staticfiles.finders.FileSystemFinder',
> >   'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> >   'django.contrib.staticfiles.finders.DefaultStorageFinder',
> > )
>
> > INSTALLED_APPS = (.
> >                                  'django.contrib.staticfiles',
> >                                  .
> >                                  )
>
> > But I still have a problem with loading the images (for example:
> > logo.jpg)
>
> > Would you please help me to get it done ??
> > What is a simple way to load images in the developing environment ??
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django-utils @async decorator and gunicorn

2011-06-27 Thread Anton Pirker
Hello! 

I use djutils [1] @async decorator for calling a function asynchronous. This 
works well when i start my server with the standard ./manage.py runserver 
command. But when i run my django app under gunicorn and i call the function 
with the @async decorator nothing happens at all... 

Do i have to configure djutils or gunicorn in a special way so i can run 
function asynchronous? 

Any hints are greatly appreciated! 

Thank's 
Anton 

[1] http://charlesleifer.com/docs/djutils/ 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/RQOAZ_lgUlwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
For example ExtJS 4 introduced new MVC app model. One of the features
and slight drawback is quite strict directory structure.

Now in most cases I can put files as static but there are occassions
when I would like to leverage power of Django templates, namely some
translations and urls

So for example in following structure:

/myapp/
/myapp/model/
/myapp/view/
/myapp/store/
/myapp/controller/

There is some (but not necessarily all) (javascript) files inside /
myapp/store/ and /myapp/view/ that I would like to load through
template rendering, specially "stores" part since it contains urls
that should point to views in my Django app and url config.

Same applies for some other files since I would like to use
translation facilities of Django.

In pseudo code I would like to do something like this:

Load static file from given url. (this would be handled by frontend
webserver in production)
If load failed:
Load dynamic file from templates dir
If load failed:
Raise error

--

Jani Tiainen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django-utils @async decorator and gunicorn

2011-06-27 Thread Javier Guerra Giraldez
On Mon, Jun 27, 2011 at 4:50 AM, Anton Pirker  wrote:
> But when i run my django app under gunicorn and i call the function with the
> @async decorator nothing happens at all...

are you running the queue consumer daemon?

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Importing file to Models - Temporary store to allow confirming?

2011-06-27 Thread Victor Hooi
Shawn,

Thanks for the quick reply =).

If we go with the third approach, what advantages are there to persisting
the models in MongoDB (or something similar like Redid.or Cassandra), as
opposed to a traditional RDBMS? (I just want to get a good handle on the
issues).

Furthermore, is there a particular reason you picked MongoDB over the other
NoSQL solutions?

Also, in terms of actually persisting the temporary models to MongoDB, I can
just use PyMongo and store the dicts themselves - and just user a nested
dict to represent all the model instances from a given import file. Any
issues with that approach?

Thanks for the tip about using asynchronous processing for the import file -
I didn't think the file would be that big/complex to process, but I suppose
it's probably the better approach to do it all asynchronously, instead of
just hoping it won't grow larger I the future. In this case, I suppose I can
just use Ajax on the page itself to check on the status of the queue?

Cheers,
Victor
On Mon, Jun 27, 2011 at 04:36, Shawn Milochik  wrote:

> If you're using Django 1.2 or higher you can take advantage of the
> multi-database support by adding the 'using' kwarg to your model.save().
> This will allow you to ensure that the model saves successfully (is valid)
> in the 'holding' database, and move it to your 'live' database later.
>
> You could add a field to the model indicating whether it's 'live' or
> 'pending,' load all the temp models as pending, then just flip the flag as
> each one is "approved." That would front-load all the processing.
>
> You can use a ModelForm to accept the CSV data (preferably in dict form,
> from csv.DictReader) to validate the data, then just check for is_valid()
> without saving anything to the database. You could then store those
> dictionaries somewhere (such as MongoDB) for retrieval when you actually
> want to save them to the database.
>
> Each of these options has different advantages. I don't know about
> performance. In any case, you may have to use asynchronous processing (via
> ZeroMQ or django-celery) so the page can refresh before you Web server's
> timeout.
>
> Use whichever seems best for your needs, and maybe someone else has another
> option. I'd prefer option #3, because it keeps all the temporary data out of
> your production database and makes good use of the validation properties of
> the ModelForm class.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Info and warning messages in admin

2011-06-27 Thread Daniele Procida
I need to be able to distinguish between info and warning messages that get 
passed to the user in admin.

I do this, and it works:

# import the admin messages framework
from django.contrib import admin, messages

class SomeForm(forms.ModelForm):
...
def clean(self):
# create a pair of empty lists for warning and information messages
SomeForm.warnings = []
SomeForm.info = []
... # do some things that add messages to the lists, based on
# things in cleaned_data
return self.cleaned_data

class SomeAdmin(admin.ModelAdmin):
...
def save_model(self, request, obj, form, change):
# loop over the lists of messages, and pass them to the messages system
for message in self.form.warnings:
messages.warning(request, message)
for message in self.form.info:
messages.info(request, message)
return super(SomeAdmin, self).save_model(request, obj, form, change)

This way yellow info messges get a little tick icon, while warnings have a 
warning sign (and really, ought to come up in orange, not yellow).

Is this a good or correct way of doing it?

Thanks for any advice or suggestions.

Daniele


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django won't send 500 or 404 emails, but django.core.mail.EmailMessage and django.utils.log.AdminEmailHandler work

2011-06-27 Thread Russell Keith-Magee
On Mon, Jun 27, 2011 at 8:02 PM, Russell Keith-Magee
 wrote:
> On Mon, Jun 27, 2011 at 7:02 AM, Kyle Gong  wrote:
>> I was trying to avoid setting up a mail server by just sending through
>> gmail's SMTP server. It is sending correctly through
>> django.utils.log.AdminEmailHandler and it was my understanding that they
>> worked through the same mechanisms?
>
> My apologies -- I didn't register that you were using connecting
> directly to GMail's servers to send mail.
>
> You haven't provided your mail settings, so it's impossible to know
> exactly what is going wrong, but my best guess would be that you don't
> have the EMAIL_USE_TLS setting enabled. GMail's servers use TLS to
> provide on-the-wire security, but Django has this turned off by
> default (since most mail servers don't enable TLS by default).
>
> As far as debugging this problem goes -- my advice would be to start
> lower in the stack. I can guarantee that if your email configuration
> is right, then 404 mails will be sent -- the real issue is whether the
> email configuration is correct. To verify this, use the mail APIs
> directly. From a Python prompt on your sever:
>
 from django.core import mail
 mail.send_mail("A subject", "This is the message", "m...@example.com", 
 ["recipi...@example.com"])
>
> substituting "m...@example.com" with your own address, and
> "recipi...@example.com" with another email address you can test with.
> This call should return 1, indicating that 1 email was sent. If it
> doesn't, or it raises an error, you should get some indication of what
> has gone wrong.

... and I've just re-read your original message, and realized that
you've already done this.

/me looks sheepish

So, If DEBUG = False, and SEND_BROKEN_LINK_EMAILS = True, then you
should be getting emails on 404s.

Trying to think of some other reasons you might not be getting error emails...

You wont be getting 500 emails if:
 * you have a custom 500 handler, or
 * if DEBUG_PROPAGATE_EXCEPTIONS is enabled

You won't be getting 404 messages if
 * the common middleware isn't enabled
 * the URLs you're hitting match the values in IGNORABLE_404_STARTS,
IGNORABLE_404_ENDS or IGNORABLE_404_URLS
 * Your user agent isn't settings a HTTP_REFERER header
 * Your user agent hasn't got a HTTP_REFERER header that matches the
domain of your server

Hope this is slightly more helpful than my last two attempts...

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django widget popup

2011-06-27 Thread Cal Leeming [Simplicity Media Ltd]
Github is absolutely amazing. Google :)

On Mon, Jun 27, 2011 at 9:37 AM, Coulson Thabo Kgathi wrote:

> no i did not. waht's github
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread Peter Murphy


On Jun 27, 8:30 pm, Coulson Thabo Kgathi  wrote:
> ok
>

Coulsen,

This is a far better response.

[Code snipped, but it gave me an idea of where you are coming
from. ;-]

> urlpatterns = patterns('',
>     # Example:
>     # (r'^questionSite/', include('questionSite.foo.urls')),
>     #(r'^questions/(?P\d+)/$', 'questions.views.detail'),
>     # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
>     #(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>     # to INSTALLED_APPS to enable admin documentation:
>
>     # Uncomment the next line to enable the admin:
>     (r'^admin/', include(admin.site.urls)),
> )
>
> so this gives me a questionnaire but i kind of hard coded the question and i
> am not using my own templete but i want to use my own templete, of which i
> suppose i will nid to use the views file and may other file so that is what
> i am failing to do.

I think you've identified the problem. You have
'question.views.details' as your view function, but you haven't
supplied the source for it. Which I believe means you _have_ to write
it, and the template that goes with it.

One thing I would add: from a user-friendliness point of view, it
might be better to have the questions in one page, or at most 5.
Hitting "Next" 21 times is a turn off for most people. But you know
your needs best.

Best regards,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django won't send 500 or 404 emails, but django.core.mail.EmailMessage and django.utils.log.AdminEmailHandler work

2011-06-27 Thread Russell Keith-Magee
On Mon, Jun 27, 2011 at 7:02 AM, Kyle Gong  wrote:
> I was trying to avoid setting up a mail server by just sending through
> gmail's SMTP server. It is sending correctly through
> django.utils.log.AdminEmailHandler and it was my understanding that they
> worked through the same mechanisms?

My apologies -- I didn't register that you were using connecting
directly to GMail's servers to send mail.

You haven't provided your mail settings, so it's impossible to know
exactly what is going wrong, but my best guess would be that you don't
have the EMAIL_USE_TLS setting enabled. GMail's servers use TLS to
provide on-the-wire security, but Django has this turned off by
default (since most mail servers don't enable TLS by default).

As far as debugging this problem goes -- my advice would be to start
lower in the stack. I can guarantee that if your email configuration
is right, then 404 mails will be sent -- the real issue is whether the
email configuration is correct. To verify this, use the mail APIs
directly. From a Python prompt on your sever:

>>> from django.core import mail
>>> mail.send_mail("A subject", "This is the message", "m...@example.com", 
>>> ["recipi...@example.com"])

substituting "m...@example.com" with your own address, and
"recipi...@example.com" with another email address you can test with.
This call should return 1, indicating that 1 email was sent. If it
doesn't, or it raises an error, you should get some indication of what
has gone wrong.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread Cal Leeming [Simplicity Media Ltd]
Hi Coulson,

Okay, I'll give you some feedback as to the code you have written below:

   - The design below means that the actual questions are assigned to a
   fixed column in the database, this is *NOT* good. You want to be using a
   'normalized' approach, by having the questions for the poll in
   a separate table, then the answers/session stored in another.

   By using the above, the code then becomes "reusable" and easily
   maintainable.

   - Good use of string formatting (using %s rather than string concat).


Hope this helps.

Cal

On Mon, Jun 27, 2011 at 11:30 AM, Coulson Thabo Kgathi
wrote:

> ok
>
> #models.py file
>
> from django.db import models
> from django.forms import ModelForm
> from django import forms
> from choices import YESNO, AGE, OPTIONS1, OPTIONS2, OPTIONS3, OPTIONS4,
> OPTIONS5, OPTIONS6, OPTIONS7, OPTIONS8, OPTIONS9, OPTIONS10, OPTIONS11,
> OPTIONS14, OPTIONS15, OPTIONS16, OPTIONS17, OPTIONS18, OPTIONS19
>
>
>
> class Questxs(models.Model):
>
>
> quest1 = models.CharField(
> verbose_name = '1. Have you ever had sexual intercourse?',
> blank = False,
> choices = YESNO,
> max_length = 5,
> )
>
> quest2 = models.CharField(
> verbose_name = '2. At what age did you begin sexual intercuorse?',
> blank = False,
> choices = AGE,
> max_length = 5,
> null = True,
> )
>
>
> quest3 =models.CharField(
> verbose_name = '3. When was the last time you had sexual
> intercourse?',
> blank = False,
> choices = OPTIONS1,
> max_length = 25,
> null=True
> )
>
> quest4 = models.CharField(
> verbose_name = '4. What decription best fits this person',
> blank = False,
> choices = OPTIONS2,
> max_length = 25,
> null = True
> )
>
> quest5 = models.CharField(
> verbose_name = '5. Is this partner older or younger than you?',
> blank = False,
> choices = OPTIONS3,
> max_length = 25,
> null = True
> )
>
> quest6 = models.CharField(
> verbose_name = '6. When did you first have sexual intercourse with
> your most recent partner?',
> blank = False,
> choices = OPTIONS4,
> max_length = 25,
> null = True
> )
>
> quest7 = models.CharField(
> verbose_name = '7. When did you last have sexual intercourse with
> this person?',
> blank = False,
> choices = OPTIONS4,
> max_length = 25,
> null = True,
> )
>
> quest8 = models.CharField(
> verbose_name = '8. The last time you had sexual intercourse with
> this partner, did you or this partner use a condom? ',
> blank = False,
> choices = YESNO,
> max_length = 25,
> null = True
> )
>
> quest9 = models.CharField(
> verbose_name = '9. Do you have children with this person? ',
> blank = False,
> choices = OPTIONS5,
> max_length = 25,
> null = True,
> )
>
> quest10 = models.CharField(
> verbose_name = '10. Are you still having sex with this person?',
> blank = False,
> choices = YESNO,
> max_length = 25,
> null = True
> )
>
> quest11 = models.CharField(
> verbose_name = '11. How often do you have sex with this person?',
> blank = False,
> choices = OPTIONS6,
> max_length = 25,
> null = True
> )
>
> quest12 = models.CharField(
> verbose_name = '12. Do you have sex with this person because you
> want to or because you feel you have to?',
> blank = False,
> choices = OPTIONS7,
> max_length = 25,
> null = True
> )
>
> quest13 = models.CharField(
> verbose_name = '13. Has he/she ever assisted you either with
> financial or material support?',
> blank = False,
> choices = OPTIONS8,
> max_length = 25,
> null = True
> )
>
> quest14 = models.CharField(
> verbose_name = '14. Do you know or believe that this person has
> other sexual partners?',
> blank = False,
> choices = OPTIONS9,
> max_length = 25,
> null = True
> )
>
> quest15 = models.CharField(
> verbose_name = '15. Do you know the HIV status of this partner?',
> blank = False,
> choices = OPTIONS10,
> max_length = 25,
> null = True
> )
>
> quest16 = models.CharField(
> verbose_name = '16. Where does this person live relative to your
> primary residence?',
> blank = False,
> choices = OPTIONS11,
> max_length = 25,
> null = True
> )
>
> quest17 = models.CharField(
> verbose_name = '17. Were you and/or your partner drunk or on drugs
> the last time you had sex?',
> blank = False,
> choices = YESNO,
> max_length = 5,
> )
>
>

Re: Sidebars

2011-06-27 Thread Cal Leeming [Simplicity Media Ltd]
Can I just clarify what you mean by sidebar?

I assume you are talking about a html element with some options inside it,
to allow you to navigate through the site?

This is (personally) how I'd do it, although others may prefer a different
style (you could probably go as far to make this whole thing "classy").

(hand typed code, may need re-writing)

--- views.py ---
page = "dashboard/help/users"

RequestContext(request, {
'section' : page.split("/")
}

--- layout.html ---
{% if section.0 = 'dashboard' %}
display stuff relating to dashboard only
{% if section.1 = 'help' %}
display stuff relating to dashboard/help only
{% endif %}
{% endif %}

On Mon, Jun 27, 2011 at 6:27 AM, Venkatraman S  wrote:

> Hi,
>
> I was looking for possible suggestions in implementing sidebars - i have a
> truck load of screens and need the sidebar to change dynamically base don
> the view. Most of the siderbar-conten is just links.
>
> I was thiking of including the various sidebar options in the base.html and
> then include a flag to check whether it has to be rendered or not; and in
> the view pass the relevant flag.
>
> Any other ideas?
>
> -venkat
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Social Networking basics? -Raj

2011-06-27 Thread Cal Leeming [Simplicity Media Ltd]
I've made a few modifications, feel free to revert/modify to your hearts
content.

On Mon, Jun 27, 2011 at 5:32 AM, Kenneth Gonsalves
wrote:

> On Sun, 2011-06-26 at 14:43 -0400, ApogeeGMail wrote:
> > I am also a newbie on this list. I have been reading the list for
> > about two months. I have learned a LOT following the questions and
> > answers. I would like to suggest that some of the links like
> > duckduck.go be added to the standard doc's page's on the right hand
> > side. I would also like to see the 'Getting Help" be on each page.
>
> I have started something on the wiki:
>
> https://code.djangoproject.com/wiki/UsingTheMailingList
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread Coulson Thabo Kgathi
ok

#models.py file

from django.db import models
from django.forms import ModelForm
from django import forms
from choices import YESNO, AGE, OPTIONS1, OPTIONS2, OPTIONS3, OPTIONS4,
OPTIONS5, OPTIONS6, OPTIONS7, OPTIONS8, OPTIONS9, OPTIONS10, OPTIONS11,
OPTIONS14, OPTIONS15, OPTIONS16, OPTIONS17, OPTIONS18, OPTIONS19



class Questxs(models.Model):


quest1 = models.CharField(
verbose_name = '1. Have you ever had sexual intercourse?',
blank = False,
choices = YESNO,
max_length = 5,
)

quest2 = models.CharField(
verbose_name = '2. At what age did you begin sexual intercuorse?',
blank = False,
choices = AGE,
max_length = 5,
null = True,
)


quest3 =models.CharField(
verbose_name = '3. When was the last time you had sexual
intercourse?',
blank = False,
choices = OPTIONS1,
max_length = 25,
null=True
)

quest4 = models.CharField(
verbose_name = '4. What decription best fits this person',
blank = False,
choices = OPTIONS2,
max_length = 25,
null = True
)

quest5 = models.CharField(
verbose_name = '5. Is this partner older or younger than you?',
blank = False,
choices = OPTIONS3,
max_length = 25,
null = True
)

quest6 = models.CharField(
verbose_name = '6. When did you first have sexual intercourse with
your most recent partner?',
blank = False,
choices = OPTIONS4,
max_length = 25,
null = True
)

quest7 = models.CharField(
verbose_name = '7. When did you last have sexual intercourse with
this person?',
blank = False,
choices = OPTIONS4,
max_length = 25,
null = True,
)

quest8 = models.CharField(
verbose_name = '8. The last time you had sexual intercourse with
this partner, did you or this partner use a condom? ',
blank = False,
choices = YESNO,
max_length = 25,
null = True
)

quest9 = models.CharField(
verbose_name = '9. Do you have children with this person? ',
blank = False,
choices = OPTIONS5,
max_length = 25,
null = True,
)

quest10 = models.CharField(
verbose_name = '10. Are you still having sex with this person?',
blank = False,
choices = YESNO,
max_length = 25,
null = True
)

quest11 = models.CharField(
verbose_name = '11. How often do you have sex with this person?',
blank = False,
choices = OPTIONS6,
max_length = 25,
null = True
)

quest12 = models.CharField(
verbose_name = '12. Do you have sex with this person because you
want to or because you feel you have to?',
blank = False,
choices = OPTIONS7,
max_length = 25,
null = True
)

quest13 = models.CharField(
verbose_name = '13. Has he/she ever assisted you either with
financial or material support?',
blank = False,
choices = OPTIONS8,
max_length = 25,
null = True
)

quest14 = models.CharField(
verbose_name = '14. Do you know or believe that this person has
other sexual partners?',
blank = False,
choices = OPTIONS9,
max_length = 25,
null = True
)

quest15 = models.CharField(
verbose_name = '15. Do you know the HIV status of this partner?',
blank = False,
choices = OPTIONS10,
max_length = 25,
null = True
)

quest16 = models.CharField(
verbose_name = '16. Where does this person live relative to your
primary residence?',
blank = False,
choices = OPTIONS11,
max_length = 25,
null = True
)

quest17 = models.CharField(
verbose_name = '17. Were you and/or your partner drunk or on drugs
the last time you had sex?',
blank = False,
choices = YESNO,
max_length = 5,
)

quest18 = models.CharField(
verbose_name = '18. Have you had any other sexual partners in the
past 12 months?',
blank = False,
choices = YESNO,
max_length = 25,
null = True
)

quest19 = models.CharField(
verbose_name = '19. Have you had any other sexual partners in the
past 12 months?',
blank = False,
choices = YESNO,
max_length = 25,
null = True
)

quest20 = models.CharField(
verbose_name = '20. In the last 12 months with how many people
OVERALL have you had sexual intercourse, including the last 3 partners we
have discussed?',
blank = False,
choices = OPTIONS14,
max_length = 25,
null = True
)

quest21 = models.CharField(
verbose_name = '21. In the last one month with how many people
OVERALL have you had sexual intercourse?',
blank = False,
choices 

Django-utils @async decorator and gunicorn

2011-06-27 Thread Anton Pirker

Hello!

I use djutils [1] @async decorator for calling a function asynchronous. 
This works well when i start my server with the standard ./manage.py 
runserver command. But when i run my django app under gunicorn and i 
call the function with the @async decorator nothing happens at all...


Do i have to configure djutils or gunicorn in a special way so i can run 
function asynchronous?


Any hints are greatly appreciated!

Thank's
Anton

[1] http://charlesleifer.com/docs/djutils/

--
DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
mobile . web . usability . project management

kranzgasse 2/15
a-1150 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://ignaz.at


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django widget popup

2011-06-27 Thread Coulson Thabo Kgathi
no i did not. waht's github

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



questionnaire and answers help

2011-06-27 Thread Coulson Thabo Kgathi
want to create a questionnaire and answers such that one question appears on
the screen at a time and once the answers is selected then the it's saved
then the next question is shown the answers to the questions are strictly
radio butoons or drop down menu this will be used for a survey on notebook
touch screens. please help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



parametric class-based form views

2011-06-27 Thread omat
Hi all,

I am trying to use generic CreateView class to handle forms for a set
of models inherited from the same base class.

class BaseContent(models.Model):
...

class XContent(BaseContent):
...

class YContent(BaseContent):
...

To keep things DRY, I want to define one CreateView class that will
handle all inherited classes from BaseContent.

The url pattern for that view is:

url(r'^content/add/(?P\w+)/$',
ContentCreateView.as_view(), name='content_add')

Something like this should work:

class ContentCreateView(CreateView):
template_name = 'content_form.html'

def get_model(self, request):
# 'content' is the name of the application; model_name is
'xcontent', 'ycontent', ...
return ContentType.objects.get_by_natural_key('content',
self.model_name)

But I am getting this exception:

ContentCreateView is missing a queryset. Define
ContentCreateView.model, ContentCreateView.queryset, or override
ContentCreateView.get_object().

This suggestion does not seem to hold as I am not willing to set a
class attribute like `model` or `queryset` to keep the model form
generated dynamic. Overriding the `get_object` does not seem relevant
for creating an object.

I tried overriding `get_queryset()` but this method does not accept
the `request` parameter, nor have access to `self.model_name` which
comes from the url pattern.

So, (how) can I make a CreateView use a dynamic form based on a
parameter passed from the url?

Thanks,
oMat

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread Peter Murphy
On Jun 27, 5:52 pm, Venkatraman S  wrote:
> On Mon, Jun 27, 2011 at 12:19 PM, Coulson Thabo Kgathi
> wrote:
>
> > want to create a questionnaire and answers such that one question
> > appears on the screen at a time and once the answers is selected then
> > the it's saved then the next question is shown the answers to the
> > questions are strictly radio butoons or drop down menu this will be
> > used for a survey on notebook touch screens. please help
>
> Write one?

Coulson,

That's probably the best advice you are going to get. You're going to
have to do it yourself - dive into HTML and get cracking. This list is
about Django, a Web framework written in Python. You're question is so
broad that it sounds like you're asking people to _design_ the whole
website for you. That may not be what you intended to convey, but
that's what it feels like.

If you intent to do your website through Django, please try to
research it as much as possible yourself. Then if your come across an
issue than you can't resolve, please have a read of this before
replying to the list:

http://www.mikeash.com/getting_answers.html

I'd also give some personal advice. It's harder to understand people
when they leave out punctuation. Periods and commas make your meaning
more clear, which makes other people more able to help you.

Best regards,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: upload file isn't working

2011-06-27 Thread Malcolm Box
On 24 June 2011 17:36, raj  wrote:

> 



> def upload_view(request):
>user = request.user
>if user.is_authenticated():
>if request.method == 'POST':
>form =upload_form(request.POST, request.FILES, user)
>if form.is_valid():
>file_instance = upload_model()
>saved_file = handle_uploads(request, ['doc'])
> #request.POST.get('title'))
>for f in saved_file:
>setattr(file_instance, f[0])
>file_instance.save()
>return HttpResponseRedirect('/user/update/success/')
>else:
>form = upload_form()
>return render_to_response('/home/oneadmin/webapps/oneadmin/
> oneadmin/templates/oneadmissions/documents.html', {'form':form},
> context_instance = RequestContext(request))
>
> my urls.py file has a url that links to the upload_view. I just cant
> seem to find why the file isn't uploading. Whenever I try to upload
> something, it just refreshes the page and states that the given fields
> are required (even though I entered all the information). Help please.
>
>
It looks to me like form.is_valid() is returning False, so you're seeing the
error messages.
You can debug the cause by putting

import pdb;pdb.set_trace()

just above the "if form.is_valid():" line and then stepping through the
validation code in the debugger.

Malcolm

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to link custom search with a view in a different app ?

2011-06-27 Thread Satyajit Sarangi
# Create your views here.

from shapes.models import *
from openmaps.models import *


from django.shortcuts import render_to_response
from django.contrib.gis.shortcuts import render_to_kml
from openmaps.models import Open_Layers
from django import forms
from openmaps.forms import GeoForm
from django.contrib.gis.geos import  GeometryCollection,
MultiPolygon,  Polygon
from openmaps.forms import ReadOnlyForm
from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from mapsearch.forms import SearchForm
from OsmMap.models import OsmLayers
from maps.models import Sdr_Layer

def map_search(request):
 lcount = Open_Layers.objects.all()

 form = SearchForm()
 if request.method == 'POST':
form = SearchForm(request.POST)
if form.is_valid():
data = form.cleaned_data
val=form.cleaned_data['LayerName']

a=OsmLayers()
b=Open_Layers()
c=Sdr_Layer()
data = []
data1=[]
data2=[]
data3=[]
data1 = 
OsmLayers.objects.filter(Layername__icontains=val)
data2 = 
Open_Layers.objects.filter(Layer_name__icontains=val)
data3 = 
Sdr_Layer.objects.filter(layer_name__icontains=val)
data.append(data1)
data.append(data2)
data.append(data3)

return render_to_response('searchresult.html', 
{'data':data})



else:
form = SearchForm()
 else:
return render_to_response('mapsearch.html', {'form':form})


This is my view that returns the search data to searchresult.html .
>From searchresult.html , all the returned data , when clicked on
should take it to a view called map_disp directly from the template .

I have read through the documentation , and this is what I inferred .

1. Pass the primary key id as a number to the map_disp view and then
use it to retrieve the date .
2. Change the urls.py so that the number is captured .

Where my doubt is this , what changes needs to be done in the view
code that I have shown here so that the number is sent .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Custom Admin Login Page

2011-06-27 Thread Thomas Guettler
Hi,

settings.LOGIN_URL get's ignored by the admin app.

I don't want two login forms, but only one.

But I couldn't find a way to redirect to my custom login form
from the admin pages.

The only solution I found was a HTML redirect like this
  http://redirect-url;>

Anyone else who has this problem, or a solution?

  Thomas




-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django widget popup

2011-06-27 Thread Venkatraman S
On Sat, Jun 25, 2011 at 6:51 AM, GKR  wrote:

> Please help
>

Did you try contacting the author on github?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: questionnaire

2011-06-27 Thread Venkatraman S
On Mon, Jun 27, 2011 at 12:19 PM, Coulson Thabo Kgathi
wrote:

> want to create a questionnaire and answers such that one question
> appears on the screen at a time and once the answers is selected then
> the it's saved then the next question is shown the answers to the
> questions are strictly radio butoons or drop down menu this will be
> used for a survey on notebook touch screens. please help
>
>
Write one?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



questionnaire

2011-06-27 Thread Coulson Thabo Kgathi
want to create a questionnaire and answers such that one question
appears on the screen at a time and once the answers is selected then
the it's saved then the next question is shown the answers to the
questions are strictly radio butoons or drop down menu this will be
used for a survey on notebook touch screens. please help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.