Re: ForeignKey 'self', save not working

2006-12-15 Thread [EMAIL PROTECTED]
Ok..after fiddling with this for what seems like forever...I finally figured out that all I needed to do was change origcompany.parent_company = new_data['parent_company_id'] to origcompany.parent_company = Company.objects.get(company_id=new_data['parent_company_id']) I thought I just

Re: Why does Django think my browser isn't accepting cookies?

2006-12-15 Thread Jeremy Dunck
On 12/15/06, DavidAtEcodata <[EMAIL PROTECTED]> wrote: > > This seems to be a known problem but no-one has offered a solution as What URL are you requesting? > so I'm convinced this is purely > a Django problem. I'm not. Don't give up. :)

Re: Why does Django think my browser isn't accepting cookies?

2006-12-15 Thread [EMAIL PROTECTED]
I've had that happen before. As I recall, sessions had gone wonky somehow. I think I closed the browser and restarted it, but I may have restarted the server. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

select_related() with the ForeignKey in the same table

2006-12-15 Thread leanmeandonothingmachine
I have a model where the foreign key refers to it self. parent = models.ForeignKey('self', core=True, null=True, blank=True) What i want to do is to be able to run a query with select_related and get all the parents of that row. When I run test = content.objects.select_related().get(pk=3) and if

Re: Getting values from a Drop Down menu

2006-12-15 Thread Joseph Heck
For debugging, start by seeing what *is* in the POST dict that you get back from the request. Super simple - just print it out and see what's in there. That might give you a clue how it's interpreting it when it comes back... -joe On 12/15/06, MattW <[EMAIL PROTECTED]> wrote: > > > Sorry, should

Re: Switching branches (was "Schema Evolution code")

2006-12-15 Thread Waylan Limberg
On 12/15/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 12/15/06, Waylan Limberg <[EMAIL PROTECTED]> wrote: > > No mention of the cross-platform path files? I would say they are > > easier to edit (comment/uncomment a line in a file) than symlink and > > as they are a python feature (not

Re: Getting values from a Drop Down menu

2006-12-15 Thread MattW
Sorry, should have made it clear on my second post in response to Massimiliano. He suggested this, and so I altered the code so it now reads: def ansQuestion(request): q = get_object_or_404(Question) answer = request.POST["answer"] A Since (at least) two people have now suggested

Re: Getting values from a Drop Down menu

2006-12-15 Thread Nathan R. Yergler
Don't you need to specify a name for the select element? If you're trying to get the selection with the key "value", I think you need to do: . . . NRY MattW wrote: > Dear All, > > A newbie with Django, but seem to be doing with some basics so far, but > seem to be a bit stuck on getting

Re: Getting values from a Drop Down menu

2006-12-15 Thread Joseph Heck
You need to tell the form what the "name" of the name value pair you're using it. SInce you're trying to look it up in your code as post['answer'] (at least based on the error you posted), that should be the name that you use in the HTML input tag . On 12/15/06, MattW <[EMAIL PROTECTED]>

Re: Getting values from a Drop Down menu

2006-12-15 Thread MattW
Ok - sorry, could you (briefly) explain what you mean? Thanks, Matt --~--~-~--~~~---~--~~ 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

Re: Getting values from a drop-down menu

2006-12-15 Thread Joseph Heck
Where are you setting "answer" in the HTML form? It should be in there as a name="" element entry of the select tag... -joe On 12/15/06, MattW <[EMAIL PROTECTED]> wrote: > > > Dear Massimiliano, > > Thanks for that; still doesn't work, I'm afraid. > > The error is: > > MultiValueDictKeyError at

Re: Getting values from a drop-down menu

2006-12-15 Thread MattW
Dear Massimiliano, Thanks for that; still doesn't work, I'm afraid. The error is: MultiValueDictKeyError at /mcq/ansQuestion/ "Key 'answer' not found in " Request Method: GET Request URL:http://localhost:8000/mcq/ansQuestion/ Exception Type: MultiValueDictKeyError Exception

Re: Getting values from a Drop Down menu

2006-12-15 Thread [EMAIL PROTECTED]
I think you need a name (and maybe ID) on your select box. --~--~-~--~~~---~--~~ 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

Re: Confused about templates and multiple objects

2006-12-15 Thread [EMAIL PROTECTED]
What are the links? Are they related to the category, the document, neither or both? I would create category. I'd establish a relationship between category and document. I'd pass my category list to the template, then loop through the categories and each categories documents with something like

Getting values from a Drop Down menu

2006-12-15 Thread MattW
Dear All, A newbie with Django, but seem to be doing with some basics so far, but seem to be a bit stuck on getting the values from a Drop Down menu. I have a method in my views.py file which starts: def ansQuestion(request): q = get_object_or_404(Question) answer =

generic list view question

2006-12-15 Thread [EMAIL PROTECTED]
I'm trying to use a generic list view like this: def latest_topic_list(request): from django.views.generic.list_detail import object_list topics = Topic.objects.order_by('-topic_modification_date')[:40] for i in topics: if i.topic_modification_date >

HttpResponseRedirect

2006-12-15 Thread Rob Slotboom
For my project I created a templatetag which handles login, logout, get profile etc. This way I can show a login/out box on every page by including the tag in the main template. There is one problem. After logging out I want to redirect the user so the cookies etc, are gone. This is what I did

Re: Looser date entry in admin...

2006-12-15 Thread Daniel Jewett
On Dec 15, 2006, at 12:17 PM, Adrian Holovaty wrote: > I'd suggest using a CharField instead. The downside to this is that > you can't take advantage of date-specific queries, such as retrieving > all the records where the date is in a certain month, but whether > that's a problem depends on

restricting comments to registration/login using django.contrib.comments

2006-12-15 Thread Milan Andric
In my urls.py, following the wiki docs on FreeComment, I'm using (r'^comments/', include('django.contrib.comments.urls.comments')), But this does not allow me to specify whether or not comments require registration/login. The only other way to do it is by defining each view in a urls.py and

Re: Changemanipulator and follow true

2006-12-15 Thread [EMAIL PROTECTED]
Ok...I've gotten this working a different way, in case anyone is interested, I thought I'd post it here (although parent_company is currently not saving for some reason..anyone?) Here is my model code...again..notice that the Company has a related Address. class Address(models.Model):

Re: Paths in Python 2.5

2006-12-15 Thread Waylan Limberg
On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote: > > Thanks but I don't have, and don't want an irc client, so I'll just > struggle along and try not to ask stupid questions. My problem is that > Python 2.5 and sqlite3 seems to be a buggy combination. (Is that true?) > Maybe sqlite3 hasn't really

Confused about templates and multiple objects

2006-12-15 Thread ejtech
Newbie here, so sorry if this is simple... I'm trying to develop a webpage that displays a PDF document library listed by category and ordered by published date. At the bottom of the page I also want a library of web links. I've got 3 models: Category(name, notes, order); Document(title,

Re: Switching branches (was "Schema Evolution code")

2006-12-15 Thread Adrian Holovaty
On 12/15/06, Waylan Limberg <[EMAIL PROTECTED]> wrote: > No mention of the cross-platform path files? I would say they are > easier to edit (comment/uncomment a line in a file) than symlink and > as they are a python feature (not an OS feature) they work on any OS. Hey Waylan, A patch to the

Re: Switching branches (was "Schema Evolution code")

2006-12-15 Thread Waylan Limberg
On 12/14/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > I've added some more instructions to the "Using branches" part of our > documentation. Let me know if this helps. > > http://www.djangoproject.com/documentation/contributing/#using-branches > > Adrian > No mention of the cross-platform

Re: Looser date entry in admin...

2006-12-15 Thread Adrian Holovaty
On 12/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What is the best way to handle situation where I sometimes I know the > exact date of an event, and sometimes I know only a less specific part? > > Recording date: 1972-10-15 (No problem) > > but when I only know the month, 1972-10, or

Why does Django think my browser isn't accepting cookies?

2006-12-15 Thread DavidAtEcodata
This seems to be a known problem but no-one has offered a solution as far as I can find out. I've just set up Django on my Windows PC, everything is working fine from the Python command line but I can't log in to the admin page - I get an error message saying my browser is not accepting cookies.

Re: Estimate memory/cpu of django?

2006-12-15 Thread Fredrik Lundh
mamcxyz wrote: > Exist any info about estimates values for memory and cpu for django? depends on what you're doing. my main django server uses around 12 megabyte memory and no noticeable CPU, during normal operations. I'm sure the Curse folks [1] use a lot more resources ;-) in other

ForeignKey 'self', save not working

2006-12-15 Thread [EMAIL PROTECTED]
Perhaps I'm not seeing something here... I thought I had this working the other day... but it isn't working now... I have a Company class... that has a parent company property which points to another company: class Company(models.Model): company_id = models.AutoField(primary_key=True)

Re: Authentication and User DB

2006-12-15 Thread Deryck Hodge
On 12/15/06, voltron <[EMAIL PROTECTED]> wrote: > Can I just extend the Django User model( class) so that the > Authentication middleware is also available for use? I have several > other fields that I need for my site. > > Can I have 2 different types of user databases and still use Djangos >

Looser date entry in admin...

2006-12-15 Thread solidether
Hello, What is the best way to handle situation where I sometimes I know the exact date of an event, and sometimes I know only a less specific part? Recording date: 1972-10-15 (No problem) but when I only know the month, 1972-10, or the year 1972, admin throws a validation error. I know I can

Authentication and User DB

2006-12-15 Thread voltron
Hi, Can I just extend the Django User model( class) so that the Authentication middleware is also available for use? I have several other fields that I need for my site. Can I have 2 different types of user databases and still use Djangos Authentication middleware? A site that I´m developing

Re: Admin login problem

2006-12-15 Thread Yatla
Jorge, Turns out that I did need to modify the url as you indicated like (r'^galeria/admin/', include('django.contrib.admin.urls')), the first time the site or my browser must have been caching something and it seemed to work. Now onwards to build the site Yatla On Dec 13, 4:35 pm, "Yatla"

Re: help with tagging app

2006-12-15 Thread Rob Slotboom
> tagging app from Luke Plant > zyons > the tagging app that jay parlar developed It seems that more and more tagging apps appear while using generic relations in admin will be available in a future Django. The last few days I've been strugling to create a menusystem. A kind of tag system but

Re: help with tagging app

2006-12-15 Thread Justin Johnson
There may be a performance issue for large object sets and retrieving all tags: def tag_list(request): all_tags = TaggedItem.objects.order_by('tag') tag_names = {} for tag in all_tags: if tag.tag not in tag_names: tag_names[tag.tag] = tag names =

Re: GenericForeignKey

2006-12-15 Thread Rob Slotboom
> paulh, take a look at > thishttp://net-x.org/weblog/2006/nov/29/django-generic-relations-made-eas... Hi Antoni, Seems interesting but the code isn't yet available I suppose... Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: help with tagging app

2006-12-15 Thread plungerman
greetings, i studied long and hard the tagging app from Luke Plant and the one from the bulletin board app called zyons (http://zyons.com/), and i was unable to wrap my head around neither. granted i am not the sharpest tool in the shed, but the docs for Sr. Plant's app are a little confusing.

Re: My second web site that use django, http://beyking.51boo.com

2006-12-15 Thread Marcus Mendes
Congrats! Very good! I've got the source for learn more . Thanks. Marcus On 12/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > This is a weblog application, source code is open > > > > > -- Marcus Mendes "A coragem é a forma de todas as virtudes em ponto de prova" C.S.Lewis

Re: GenericForeignKey

2006-12-15 Thread zenx
paulh, take a look at this http://net-x.org/weblog/2006/nov/29/django-generic-relations-made-easier/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Re: Schema Evolution code

2006-12-15 Thread Russell Keith-Magee
On 12/15/06, Steve Hutton <[EMAIL PROTECTED]> wrote: > > > Assuming that the implementation matches the proposal, I would say > > there is a realistic chance of it getting accepted into core. However, > > this would require that the implementation is up to date, and bug free > > (including tests

Re: Schema Evolution code

2006-12-15 Thread Steve Hutton
On 2006-12-14, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 12/13/06, Steve Hutton <[EMAIL PROTECTED]> wrote: > >> Does it have a realistic chance of being accepted into core if it's found >> to be bug free? Is it fully documented? Is the design controversial or >> does it follow a