Best practice for auth.User/UserProfile division?

2010-08-22 Thread adambossy
I'm helping build a social networking site which makes heavy use of django built-in User model and its relationship to other Users on the site. We created a UserProfile per the django documentation [http:// docs.djangoproject.com/en/dev/topics/auth/#storing-additional- information-about-users]

Re: django-admin.py cleanup large scale

2010-08-22 Thread bfrederi
When I attempt to run a normal cleanup, the cleanup eventually loses connection to the database and dies. I think I am going to have to take the manual approach. One thing that I wanted to point out is that I think you meant the SQL equivalent is: DELETE FROM django_session WHERE expire_date <

Re: overriding the admin save in admin.py?

2010-08-22 Thread Aspontus
Hi. Why don't you use save() method in model definition? See http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-methods Maybe this will help you. Cheers. On 22 Sie, 14:27, gondor wrote: > i'm trying to override the save function so I can add set some values

Re: Django on Mac OS X

2010-08-22 Thread Daniel França
thanks Andrew, Now I've installed Pinax into a Virtualenv and it's working fine...I installed only the libs versions that Pinax script install. On Sat, Aug 21, 2010 at 10:55 PM, AndrewK wrote: > I've had the same problem on my Mac just now. > It seems like this is an issue

What is the best way to manually create an HTML form from a ModelForm

2010-08-22 Thread orokusaki
Normally, I would do something like this: {% for field in form.fields %} {% field %} {% endfor %} What if I need: {% one field %} Some Title {% another field %} I want to be able to still use model forms and I don't want to hard code {% if field == "email"

Re: help with understanding tag cloud code

2010-08-22 Thread Mike Dewhirst
On 23/08/2010 11:17am, John Yeukhon Wong wrote: Hi, I am confused with this piece of code. This is a code responsible for building a tag cloud. It lives in the views.py The part I don't understand is # Calculate tag, min and max counts. min_count = max_count =

Re: the body of an http request

2010-08-22 Thread Yangmin Li
you can access from HttpRequest.REQUEST *it is a dictionary like object.* *more info, you can refer : * http://docs.djangoproject.com/en/dev/ref/request-response/ On Mon, Aug 23, 2010 at 4:57 AM, Porya Jahandideh wrote: > Hi! > How can I access the body of an http request

help with understanding tag cloud code

2010-08-22 Thread John Yeukhon Wong
Hi, I am confused with this piece of code. This is a code responsible for building a tag cloud. It lives in the views.py The part I don't understand is # Calculate tag, min and max counts. min_count = max_count = tags[0].bookmarks.count() I never had used this 3 assignments in Python

Re: Error: No module named tp.urls | Exception Type: ImportError

2010-08-22 Thread AJ
ROOT_URLCONF = 'tp.urls' Just saw this in my settings.py --AJ On Aug 22, 8:33 pm, Aman wrote: > I recently installed Django on my personal Ubuntu Dev Server and have > been trying with mod_wsgi (as mod_python is officially dead). I just > had some breakthrough where I

Re: Error: No module named tp.urls | Exception Type: ImportError

2010-08-22 Thread AJ
ROOT_URLCONF: 'tp.urls' I just saw that line in my settings.py --AJ ` On Aug 22, 8:33 pm, Aman wrote: > I recently installed Django on my personal Ubuntu Dev Server and have > been trying with mod_wsgi (as mod_python is officially dead). I just > had some breakthrough

Error: No module named tp.urls | Exception Type: ImportError

2010-08-22 Thread Aman
I recently installed Django on my personal Ubuntu Dev Server and have been trying with mod_wsgi (as mod_python is officially dead). I just had some breakthrough where I could see a little progress as a Django error and now I am stuck. Could you please tell me what might be wrong here? Debug

the body of an http request

2010-08-22 Thread Porya Jahandideh
Hi! How can I access the body of an http request using an HttpRequest object? Thanks in advance. -- PJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this

A replacement for fixtures

2010-08-22 Thread Mark Sandstrom
Hello all, I've created a test fixtures replacement named factory_boybased on thoughtbot's factory_girl for Ruby. Factories are extremely maintainable and can make tests more readable. The framework can be used for any Python project, and Django support is

Re: Stucked in Tutorial 3

2010-08-22 Thread Timothy Makobu
Also, if you haven't already, read all of this http://docs.python.org/tutorial/index.html first before diving into Django. A firm grip on Python is needed to learn Django and write good applications. On Sun, Aug 22, 2010 at 8:53 PM, Nick wrote: > the problem is on the return

Extract ForeignKey value from QuerySet

2010-08-22 Thread Goran
I'm Django novice and trying to get some search page. I'm lost almost all day trying to extract ForeignKey value from my QuerySet without success. Have city name which is ForeignKey in MyModel and I always get result = []. Here is my last view. from django.db.models import Q from django.shortcuts

Re: gettext on windows - not up to date documentation on django site

2010-08-22 Thread Ramiro Morales
On Sun, Aug 22, 2010 at 5:17 PM, Jonathan wrote: > Right, my bad. > > Now that I installed it, the project which works great on Linux with > translations and all, still does not have translations on Windows. > What else should be configured?  (yes, I updated the system

Re: gettext on windows - not up to date documentation on django site

2010-08-22 Thread Jonathan
Right, my bad. Now that I installed it, the project which works great on Linux with translations and all, still does not have translations on Windows. What else should be configured? (yes, I updated the system PATH correctly) On Aug 22, 9:42 pm, Baurzhan Ismagulov wrote: >

Re: installing DB engine

2010-08-22 Thread Reinout van Rees
On 08/22/2010 04:54 PM, matches wrote: I'm trying to install the mySQL db adapter. Do I really need to compile it before I can get it to work? Is there an easier way? You ought to be able to grab an installer for your OS. So "aptitude install python-mysqldb" for ubuntu, for instance. I'm sure

Re: gettext on windows - not up to date documentation on django site

2010-08-22 Thread Baurzhan Ismagulov
On Sun, Aug 22, 2010 at 10:03:33AM -0700, Jonathan wrote: > In > http://docs.djangoproject.com/en/1.1/topics/i18n/localization/#gettext-on-windows > it says "Extract the contents of the bin\ directories in both files to > the same folder on your system". > I downloaded gettext-0.17.tar from the

Re: Stucked in Tutorial 3

2010-08-22 Thread Nick
the problem is on the return HttpResponse (t.render(c)) line. Check that your indentation is correct On Aug 22, 9:51 am, craphunter wrote: > Hi, > > I am very new in Django and Python. I am stucked in Tutorial 3 in part > "Write views that actually do something". > > I don't

gettext on windows - not up to date documentation on django site

2010-08-22 Thread Jonathan
In http://docs.djangoproject.com/en/1.1/topics/i18n/localization/#gettext-on-windows it says "Extract the contents of the bin\ directories in both files to the same folder on your system". I downloaded gettext-0.17.tar from the link provided and it did not have a bin directory in it. What should

Re: Touch-ing django.wsgi doesn't reliably reload source code

2010-08-22 Thread Jim
> Graham Thank you; that solved my problem. That was a big help to me. I bought a couple of things from your wish list -- I hope that your child enjoys them. Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Stucked in Tutorial 3

2010-08-22 Thread craphunter
Hi, I am very new in Django and Python. I am stucked in Tutorial 3 in part "Write views that actually do something". I don't get it to run the index.html. I have copied: " from django.template import Context, loader from mysite.polls.models import Poll from django.http import HttpResponse def

Re: searching stackedinline fields via search_fields in admin

2010-08-22 Thread ringemup
To add a filter that works with a related field, you have to write a custom filterspec (which isn't really documented anywhere AFAIK). To add the search on the related fields you just need to do what I described above: class CarAdmin(admin.ModelAdmin) search_fields = ['model',

installing DB engine

2010-08-22 Thread matches
I'm trying to install the mySQL db adapter. Do I really need to compile it before I can get it to work? Is there an easier way? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: check email duplication at registration

2010-08-22 Thread John Yeukhon Wong
Hi, thank you for pointing out the problem! Solved! 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-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Loop over a form's choices (radio button) and render it

2010-08-22 Thread Andreas Pfrengle
Hello Bill, thanks for the code. It took half the weekend, but finally I built upon this to get a radiobutton-iterator. This was a bit more complicated, since the RadioInput widget has no own render-method, so I needed to introduce a helper class that derives from RadioInput. I've put the code

overriding the admin save in admin.py?

2010-08-22 Thread gondor
i'm trying to override the save function so I can add set some values that were hidden before saving. The problem is it doesn't seem to be using the save_model? Does anyone know how this is done models.py class Contact(models.Model): user = model.ForeignKey(User, editable=False) notes =

Re: defining models for unit testing only

2010-08-22 Thread Atamert Ölçgen
Hi, > I wrote a django 'app', thats basically just a class that takes a > Queryset, some other information, and then outputs an HttpResponse > object (it does some other things too). How do I write unit tests for > this class? The app itself does not contain any models, yet the > functionality of

Re: Need some help with URL layout

2010-08-22 Thread Uwe Schuerkamp
Hi folks, one more thing: In order to allow chaning of countries / regions, I was thinking of adding a bit of html to the top of each page where a user can select the country in the first popup, then the region popup populates (pun intended ;-) the the regions for the selected country, and one

Re: Django-Cms Installation Error

2010-08-22 Thread Jagdeep Singh Malhi
On Aug 21, 10:17 pm, Marek Dudek wrote: > You have django 1.2.1, now I noticed > I wasn't able to install any version of django-cms with django 1.2.1 and > I tried 2.0.0, 2.0.1, 2.0.2 and 2.1.0-beta3 > Most up-to-date combination that I successfully installed is django >