Re: Multiple Choice Quiz

2012-03-24 Thread Babatunde Akinyanmi
Hi jbr3, Check scrabala.com Is it similar to what you are working on? On 3/23/12, jbr3 wrote: > Hi again, > > I've been trying to figure this out for awhile, but to no avail. I'll > try to list the problems I've had in understanding it. > > 1. I'm not sure what the forms.py file should look like.

Re: Accessing objects from a dictionary in templates

2012-03-24 Thread Sam Lai
On 24 March 2012 09:29, gowtham wrote: > Template tag filters like this (made one for each field in the library > object) helps me to get what i wanted But, that seems too silly to do... > > in template > {{ reslibdic|hash2libcode:res.result_id }} > I had the same thought as Reinout did, but

Re: sql for Many To Many Field in existing django model

2012-03-24 Thread Nikhil Verma
Hi I am able to create the field through in postgres. When i execute that sql statement :- CREATE TABLE "visit_visit_research" ( "id" serial NOT NULL PRIMARY KEY, "visit_id" integer NOT NULL REFERENCES "visit_visit" ("id") DEFERRABLE INITIALLY DEFERRED, "research_id" integer NOT NULL

Re: Pip install matplotlib error with virtualenv

2012-03-24 Thread darwin_tech
Yes, that is true. I set the virtualenv with --no-site-packages as I want a reproducible environment for my Django project. This should not mean that I cannot install matplotlib within the virtualenv though, surely? Sam On Friday, 23 March 2012 14:42:55 UTC-6, Reinout van Rees wrote: > > On 23-

Re: ANNOUNCE: Django 1.4 released

2012-03-24 Thread Brian Neal
On Friday, March 23, 2012 12:11:22 PM UTC-5, James Bennett wrote: > > Django 1.4 is finally here! > > For details, checkout the weblog: > > https://www.djangoproject.com/​weblog/2012/mar/23/14/ > > And the release notes: > > https://docs.djangop

Re: Abridged summary of django-users@googlegroups.com - 45 Messages in 19 Topics

2012-03-24 Thread William Slippey
On Sat, Mar 24, 2012 at 9:22 AM, wrote: > Today's Topic Summary > > Group: http://groups.google.com/group/django-users/topics > >- sql for Many To Many Field in existing django > model<#13644df8deb67955_group_thread_0>[1 Update] >- problem with admin settings <#13644df8deb67955_group_t

[no subject]

2012-03-24 Thread William Slippey
-- 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

Re: Accessing objects from a dictionary in templates

2012-03-24 Thread gowtham
Hi Samuel, Thanks a ton for this detailed suggestion. I was almost certain, the solution i was trying is not the optimal. Now its very clear. Thanks very very much. You made my weekend. I will be all busy backing up my database and implementing what you suggested. Initially after reading your rep

Re: Multiple Choice Quiz

2012-03-24 Thread jbr3
Babatunde, Yes, that's basically the same idea. The questions would all be on the same page, however, and I wouldn't incorporate the time limit. But, that's mostly what I was thinking of. On Mar 24, 3:08 am, Babatunde Akinyanmi wrote: > Hi jbr3, > Check scrabala.com > Is it similar to what you a

django-admin login doubt

2012-03-24 Thread dummyman dummyman
Hi, Is there a way to prevent django asking username and password from 127.0.0.1:8000/admin or any other form in 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 unsu

Re: Customizie admin views

2012-03-24 Thread dummyman dummyman
hi u can override response_change method def response_change(self,request,obj): On Fri, Mar 23, 2012 at 7:33 PM, jsdey wrote: > I have a project photos that has a model Album. Admin (/admin/photos/ > album/ page has a button "Add Album". I want to write a custom page > for that action but c

Re: Customizie admin views

2012-03-24 Thread John S. Dey
Thanks for the tip. I'm new to django/python and need a little bit of coaching. I found the response_change method in options.py as part of the ModelAdmin class. What is the best way to override? Could I create a class that inherits ModelAdmin and place the modified response_change in it. W

Re: Customizie admin views

2012-03-24 Thread dummyman dummyman
in admin.py # import your model from django.contrib import admin class MyAdmin(admin.ModelAdmin): def response_change(self,request,obj): result = super(MyAdmin, self).response_change(request, obj) document=Yourmodel.objects.get(idcontent=obj.idcontent) #rest of the

Re: Customizie admin views

2012-03-24 Thread John S. Dey
Thanks so very much for the advise. I'll give it a try. On Mar 24, 2012, at 2:23 PM, dummyman dummyman wrote: > in admin.py > > # import your model > from django.contrib import admin > > > class MyAdmin(admin.ModelAdmin): > def response_change(self,request,obj): > >

Re: Admin - how to get all registeres models in templatetag?

2012-03-24 Thread dummyman dummyman
Yes it is possible override the django admin template http://www.djangobook.com/en/1.0/chapter17/ this link would b helpful On Thu, Mar 22, 2012 at 3:49 PM, rohit jangid wrote: > I'm using the default admin for my purpose there was a time when I was > thinking the same but I didn't wanted to r

Re: filtered admin change-list

2012-03-24 Thread omerd
thank you, it worked. I wrote queryset, has_change_permission and save_model in my ModelAdmin. As i see it, django-guardian intended for low level permissions in the web application itself, not the admin-interface. By the way, is it safe and secure to allow any user (which is not superuser and is

Keep getting 404 error

2012-03-24 Thread Mika
I'm a total newbie to django and just started the book. I created a project and I'm now trying to create my first page, but I keep getting an error page that says: Page not found (404) Request Method: GET Request URL:http://127.0.0.1:8000/ Using the URLconf defined in redlab.urls, Django tried

Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-24 Thread Homer
I tried to create an index webpage but Django told me I had a template error: Invalid block tag: 'endblock', expected 'empty' or 'endfor' Here is the code of index.html: {% extends "base.html" %} {% block title %}Home{% endblock %} {% block content %} Welcome to So Easy! 学中文 Showcase {% for

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-24 Thread Jesramz
Is there an {% endblock footer %} ? -- 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

__unicode__ and return.self

2012-03-24 Thread spike
Running the tut here: https://docs.djangoproject.com/en/1.1/intro/tutorial01/ but I'm having trouble understanding what the point of __unicode__ is. Also, what is the point of the return statements? I've read the docs over and over but don't get it. -- You received this message because you

Re: __unicode__ and return.self

2012-03-24 Thread Jonathan Baker
The __unicode__ method allows models to return a more usable representation of a record instead of a unicode object. This is useful in a variety of places, from the Django admin to using the manage.py shell on the command line. The return statement effectively ends the execution of a particular fu

Re: __unicode__ and return.self

2012-03-24 Thread MF-DOS
Thanks for the reply. If my model has 5 fields, why am I only returning one or two? Shouldn't I return all 5? On Mar 24, 9:19 pm, Jonathan Baker wrote: > The __unicode__ method allows models to return a more usable representation > of a record instead of a unicode object. This is useful in a var

Re: __unicode__ and return.self

2012-03-24 Thread Jonathan Baker
Glad to help. How the record is represented is up to you. For instance, if I have a Person model with the fields first_name, middle_name, last_name, email_address and phone number, I would think it prudent to define __unicode__ as: def __unicode__(self): return '%s %s' % (self.first_name, self

all(), get(), create(), count(). More info?

2012-03-24 Thread MF-DOS
Running this tut: https://docs.djangoproject.com/en/1.1/intro/tutorial01/ Here is a list of shell commands I'm asked to issue, but I don't understand where the commands are coming from? Are these Django or Python commands? I've attempted to query help and read the docs but can't find them anywhere

Re: all(), get(), create(), count(). More info?

2012-03-24 Thread Jonathan Baker
.all(), .filter(), .get() are methods invoked through Django model managers ('objects' in this case). The methods are made available when you create a model class that inherits from models.Model. To use any of them from a shell, you'll need to invoke the python interpreter using the following mana

Re: __unicode__ and return.self

2012-03-24 Thread spike
Thanks for the reply. Why am I only returning one or two fields from each model? If I define 5 fields, shouldn't I return all 5? On Saturday, March 24, 2012 9:19:51 PM UTC-7, jondbaker wrote: > > The __unicode__ method allows models to return a more usable > representation of a record instead

How to Detect Current Page as Homepage?

2012-03-24 Thread easypie
I'm trying to check {% if homepage %} then show {% endif %} I'm not sure how to go about a test to check the current page if it's my homepage. Do I need to mess around with context processors? What's the usual way of doing it? And how would the {% if ... %} look like? -- You received this mes

myproject/wsgi.py vs. myproject.wsgi?

2012-03-24 Thread Micky Hulse
Hello, This is is probably a silly question, but... I just installed a fresh copy ofDjango 1.4 (mod_wsgi 3.3/Python 2.7) on my WebFaction server. In 1.3, the command startproject (IIRC) generated a myproject.wsgi that lived next to myporject folder. In the 1.4 installer, the wsgi file i