Re: model form validation always failing

2009-05-19 Thread watad
this is my form after thomas reply: {{ form.as_p }} and this is my view after your reply : def careerspage(request): if request.method == 'POST': form = CareerForm(request.POST,request.FI

Exception in model in admin with non unicode

2009-05-19 Thread Oleg Oltar
Hi! I am creating a simple application for managing articles. It contains of several entities: 1) categories 2) sections 3) articles The code: class Categoty(models.Model): categoty = models.CharField(max_length=200) name = models.CharField(max_length = 200, help_text="Имя категории")

Re: User attribute access from within profile model

2009-05-19 Thread Ayaz Ahmed Khan
On 20-May-09, at 12:12 AM, neridaj wrote: > On May 19, 1:15 am, Ayaz Ahmed Khan wrote: >> On 19-May-09, at 5:12 AM, neri...@gmail.com wrote: >> >>> class Employee(models.Model): >>> user= models.ForeignKey(User, unique=True) >>> phone = PhoneNumberField() >>> ssn = models.CharField(max_len

Re: Django version

2009-05-19 Thread VidrSan
O_o This function does not exist >>>'module' object has no attribute 'get_version' --~--~-~--~~~---~--~~ 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.c

Error in basic template in admin

2009-05-19 Thread Diogo Baeder
Hi, guys, I'm having an issue with the basic admin template at my project... basically, it says that it doesn't see an "urls" module, in a line that tries to include links to the admin documentation, but I've not activated the documentation! :-( Can I post an image here with the traceback scr

Re: Recursive ManyToMany field question

2009-05-19 Thread Adam Olsen
On Tue, May 19, 2009 at 11:12 PM, Russell Keith-Magee wrote: > You're looking for a non-symmetrical m2m relation: > > http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField.symmetrical > Exactly what I was looking for, thanks! -- Adam Olsen http://www.vimtips.

Re: Recursive ManyToMany field question

2009-05-19 Thread Russell Keith-Magee
On Wed, May 20, 2009 at 12:57 PM, Adam Olsen wrote: > > I'm trying to make a tagging application.  I want to have tags that > have related tags, ie, if they choose the tag 'car', it should also > choose 'automobile'.  If they choose 'automobile', it should not > automatically choose 'car'.  I'm u

Recursive ManyToMany field question

2009-05-19 Thread Adam Olsen
I'm trying to make a tagging application. I want to have tags that have related tags, ie, if they choose the tag 'car', it should also choose 'automobile'. If they choose 'automobile', it should not automatically choose 'car'. I'm using something like: class Tag(models.Model): name = models

Re: Rendering models using their own templates

2009-05-19 Thread Roberto Cea
HI Eric, thanks for the reply. I sort of found a solution, by poking through the contrib.syndication app, I added this function to my model: from django.template import loader def render(self): html_tmp = loader.get_template(self.html_template_name) html = loader.render_to_stri

Generic subclass accessor for model inheritance?

2009-05-19 Thread Roberto Cea
I have a BaseModel and n models that subclass it. Each instance of the BaseClass has a .name_of_subclass attribute that returns the subclass instance associated with it. Is there a generic way of accessing this instance without knowing beforehand the name of the subclass, something like base_class

Re: Rendering models using their own templates

2009-05-19 Thread Eric Abrahamsen
On May 20, 2009, at 10:53 AM, Roberto Cea wrote: > > I have a large amount of optional components (with a model for each > one) that will be freely inserted by my users, and it would be > impractical to render each one in a single large template. > I want to give each component a ".render()" met

Re: if number <= othernumber

2009-05-19 Thread brawaga
Excuse me for my awful english ;) On May 13, 7:33 pm, "richardcur...@googlemail.com" wrote: > Can I do in Django 0.9 something like if number <= othernumber ? Try to create your own filter that compares things (numbers as a case) In that particular case when you want to check a length of a lis

Re: Best Django host

2009-05-19 Thread Eugene Lazutkin
>From my experience with both hosts webfaction has a better uptime, better setup, and less interferences from neighbors, which is important on shared hosts. Thanks, Eugene Lazutkin http://lazutkin.com/ On 05/19/2009 09:41 PM, LeonTheCleaner wrote: > Thanks, I saw that link. But why webfaction i

Re: Best Django host

2009-05-19 Thread Roberto Cea
Webfaction has small-amount-of-clicks install for Django, and the support staff is both knowledgeable (about Django and other topics) and helpful. It's very Django friendly. On May 19, 10:41 pm, LeonTheCleaner wrote: > Thanks, I saw that link. But why webfaction is better. It has the same > manu

Rendering models using their own templates

2009-05-19 Thread Roberto Cea
I have a large amount of optional components (with a model for each one) that will be freely inserted by my users, and it would be impractical to render each one in a single large template. I want to give each component a ".render()" method, so I can just call that from the template. However, I do

Re: Best Django host

2009-05-19 Thread LeonTheCleaner
Thanks, I saw that link. But why webfaction is better. It has the same manual steps to install django, right? I can see a 1 click install would be good, but why these are better than say dreamhostÉ Thanks. On May 19, 8:06 pm, Zain Memon wrote: > http://djangofriendly.com/ > > On Tue, May 19,

Re: Best Django host

2009-05-19 Thread Zain Memon
http://djangofriendly.com/ On Tue, May 19, 2009 at 6:21 PM, LeonTheCleaner wrote: > > Hi, > > I currently use dreamhost, but the installation process is very slow. > Is it me or this process is overly complicated? All I want is to > install an already written django project but to do that it's li

Re: Formwizard with inlines

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 8:53 PM, ringemup wrote: > > This ticket indicates that formsets can't be used with FormWizards > ( http://code.djangoproject.com/ticket/2 ). Does that also mean > that inlineformsets are also no go? > > Thanks! > > > Yes, inline formsets are a subclass of formsets.

Formwizard with inlines

2009-05-19 Thread ringemup
This ticket indicates that formsets can't be used with FormWizards ( http://code.djangoproject.com/ticket/2 ). Does that also mean that inlineformsets are also no go? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Best Django host

2009-05-19 Thread LeonTheCleaner
Hi, I currently use dreamhost, but the installation process is very slow. Is it me or this process is overly complicated? All I want is to install an already written django project but to do that it's like I have to write the app myself. I read about dreamhost being not the best, but it's listed

Re: Installing django

2009-05-19 Thread LeonTheCleaner
Thanks for replying. I wanted to do that, but I canèt find the file. I use win btw. Also I am trying to install this on my host (dreamhost). Am I supposed to do this operation on my machineÉ Thanks. On May 19, 4:27 pm, Aneesh wrote: > What operating system are you using?  If it's unix, Linux

Re: Raises Http404 from Middleware?

2009-05-19 Thread ringemup
Yikes. Is there any workaround? Say, calling process_exception() on whatever middleware class usually handles this stuff? On May 19, 8:56 pm, Alex Gaynor wrote: > On Tue, May 19, 2009 at 7:54 PM, ringemup wrote: > > > When I raise a 404 exception from a middleware process_request method, > >

Re: Raises Http404 from Middleware?

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 7:54 PM, ringemup wrote: > > When I raise a 404 exception from a middleware process_request method, > the traceback is posted to the browser instead of a proper debug error > page. Is there something special one has to do in order to properly > return a 404 page from midd

Raises Http404 from Middleware?

2009-05-19 Thread ringemup
When I raise a 404 exception from a middleware process_request method, the traceback is posted to the browser instead of a proper debug error page. Is there something special one has to do in order to properly return a 404 page from middleware? Thanks! --~--~-~--~~~--

Re: ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-19 Thread Margie
One more thing - when I first noticed the bug, I was using admin.site.root in the urls reference. But when pruning down the test case I moved to including admin.site.urls - that seemed to make no difference. Margie --~--~-~--~~~---~--~~ You received this message

Re: Tutorial part 4 doubt

2009-05-19 Thread Karen Tracey
On Tue, May 19, 2009 at 7:36 PM, eric wrote: > > Hi > > I know it is just an tutorial, but I would like to know how you handle > this issue. > > this is the code in 4th tutorial: > {{{ > def vote(request, poll_id): >p = get_object_or_404(Poll, pk=poll_id) >try: >selected_choice =

Tutorial part 4 doubt

2009-05-19 Thread eric
Hi I know it is just an tutorial, but I would like to know how you handle this issue. this is the code in 4th tutorial: {{{ def vote(request, poll_id): p = get_object_or_404(Poll, pk=poll_id) try: selected_choice = p.choice_set.get(pk=request.POST['choice']) except (KeyError,

Re: can't create django project

2009-05-19 Thread MFA
I'm a rook too and received the same error. I re-read the installation instructions here: http://docs.djangoproject.com/en/dev/topics/install/#installing-official-release It turns out I had to run "python setup.py install". I believe this copies the django-admin.py to a location, or places a p

Re: user object in login.html

2009-05-19 Thread Jon
Ah, and if you only want to display a message on the login page, that's possible too. In that case you don't use the redirect in the view, but use an if clause in your index.html template. Something like this: {% if logged_in %} You are logged in already. {% endif %} Jon. On May 20, 2:18 am,

Re: user object in login.html

2009-05-19 Thread Jon
Simply have an 'if logged in:' clause at the beginning of your login view definition that redirects to the /loggedin/ view if it matches. Of course this implies that you know some variable that will always match once someone is logged in. Most likely, django sets this already. If you cannot fin

Re: Conditionally redirecting admin requests?

2009-05-19 Thread ringemup
Answered my own question: yes. root() just has to return an HttpResponse. On May 19, 4:48 pm, ringemup wrote: > I need users to have filled out out a form wizard to complete their > profile before they can use the admin site -- basically to hijack the > request and redirect it if the profile

Re: Creating a custom form from models, problems when ordering

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 2:53 PM, ccsakuweb wrote: > > I have a form from a model. I add 3 new inputs. Then when I write in > Meta : > model = models.Table > fields = ['attribute2', 'newInput1', 'newInput2', 'newInput3', > 'attribute3'] > for example, the final order is not respect the new inputs.

can't create django project

2009-05-19 Thread rookie
Hi, I just install django and try to create django project following the instruction: django-admin.py startproject mysite However, I got the message sais: 'django-admin.py' is not recognized as an internal or external command, operable program or batch file. In pythonwin (Python 2.6 version

Creating a custom form from models, problems when ordering

2009-05-19 Thread ccsakuweb
I have a form from a model. I add 3 new inputs. Then when I write in Meta : model = models.Table fields = ['attribute2', 'newInput1', 'newInput2', 'newInput3', 'attribute3'] for example, the final order is not respect the new inputs. Only respect the attributes of the model in the fields array. Th

Conditionally redirecting admin requests?

2009-05-19 Thread ringemup
I need users to have filled out out a form wizard to complete their profile before they can use the admin site -- basically to hijack the request and redirect it if the profile is incomplete. Can this be accomplished by simply subclassing AdminSite and writing a custom root () method? --~--~-

Re: Installing django

2009-05-19 Thread Aneesh
What operating system are you using? If it's unix, Linux, or Mac OS X, there should be a file named ".bash_profile" in your home directory (if you're using bash). You can run the export statements directly from a shell prompt on any of these OS-es. You should also put the export statements in t

Re: ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-19 Thread Margie
When I do that I just get '1.1 beta 1' (no svn revision info). However, I can see that I am in my newly installed library by putting pdb.set_trace() into the code. I checked it out like this: svn co http://code.djangoproject.com/svn/django/trunk/ django_trunk_05_18 At the end it printed: Ch

Re: User attribute access from within profile model

2009-05-19 Thread Sam Chuparkoff
On Tue, 2009-05-19 at 12:12 -0700, neridaj wrote: > There are attributes for first_name and last_name, why wouldn't > user.first_name work? I'd expect an AttributeError is you are accessing an attribute that doesn't exist. Thus my assumption. sdc --~--~-~--~~~---~-

Re: ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 2:21 PM, Margie wrote: > > I tried it on trunk (checked out yesterday) and I see the problem > there as well. Note, this is in the change list view. The problem > doesn't appear in the edit forf view. Here's my testcase: > > ### urls.py > > from django.conf

Re: ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-19 Thread Margie
I tried it on trunk (checked out yesterday) and I see the problem there as well. Note, this is in the change list view. The problem doesn't appear in the edit forf view. Here's my testcase: ### urls.py from django.conf.urls.defaults import * from django.conf import settings from

Re: User attribute access from within profile model

2009-05-19 Thread neridaj
There are attributes for first_name and last_name, why wouldn't user.first_name work? On May 19, 1:15 am, Ayaz Ahmed Khan wrote: > On 19-May-09, at 5:12 AM, neri...@gmail.com wrote: > > > class Employee(models.Model): > >  user= models.ForeignKey(User, unique=True) > >   phone = PhoneNumberField

Re: MultiValueField with required=True problem

2009-05-19 Thread Sam Chuparkoff
On Mon, 2009-05-18 at 10:13 -0700, [CPR]-AL.exe wrote: > I've created a field+widget set that i use to render a number of > checkboxes and a TextInput with comma-separated values. > > The problem is, when i set required = True, I get a ValidationError if > only checkboxes are selected (but i don'

Re: Separate User namespace

2009-05-19 Thread Timboy
Initially we will have in the ballpark of 10,000 Private users. Anyone have an idea on an additional user namespace? On May 19, 8:42 am, Aneesh wrote: > How many private users do you have?  If it's just a small number, > consider using the same model for all Users, and making some profiles > p

Re: HTML works directly in browser, but not in DJango... Why???

2009-05-19 Thread Colin Bean
On Tue, May 19, 2009 at 11:44 AM, Alex Gaynor wrote: > > > On Tue, May 19, 2009 at 1:42 PM, Social Network in DJango > wrote: >> >> I put the below code to embed an mp3 file in an html page in an html >> file and pointed my browser to it.  It works. >> >> I then try >>     url(r'^$','django.view

Re: how to work with web service in django

2009-05-19 Thread LiLi
hey nick! tnx for advice.. I will try those things :) From: Nick Lo To: django-users@googlegroups.com Sent: Tuesday, May 19, 2009 1:36:35 AM Subject: Re: how to work with web service in django Hello, > I'm trying to make application in wich you will search

Re: HTML works directly in browser, but not in DJango... Why???

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 1:42 PM, Social Network in DJango < readb...@gmail.com> wrote: > > I put the below code to embed an mp3 file in an html page in an html > file and pointed my browser to it. It works. > > I then try > url(r'^$','django.views.generic.simple.direct_to_template', > {"templ

HTML works directly in browser, but not in DJango... Why???

2009-05-19 Thread Social Network in DJango
I put the below code to embed an mp3 file in an html page in an html file and pointed my browser to it. It works. I then try url(r'^$','django.views.generic.simple.direct_to_template', {"template": "wimpybutton.html"}, name="home"), Then, http://127.0.0.1:8080/ I do not see the button. I

Re: http://127.0.0.1:8000/admin/admin/logout/ (duplicate admin)

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 1:20 PM, Jesse wrote: > > Thanks! I'm in the middle of reloading everything again, because I > thought it was something I had done. Good to know that wasn't the > case and glad they are working on it. > Thanks, again! > > On May 19, 11:11 am, Reiner wrote: > > I stumble

Installing django

2009-05-19 Thread LeonTheCleaner
Hi, I am trying to install django by using this: http://wiki.dreamhost.com/Django but there are a few things I don't understand. 1. Where am I supposed to run stuff like these: export PATH=$PATH:$HOME/django_src/django/bin export PYTHONPATH=$PYTHONPATH:$HOME/django_src:$HOME/django_projects

Form Help

2009-05-19 Thread eric.frederich
I need a view to edit Enrollment objects for a particular Offering. An Offering has a foreign key to a Room and a Course. All three of these (Offering, Room, and Course) have a maximum capacity field which can be null (for unlimited). Offering has a method called get_max_capacity() which return

Re: http://127.0.0.1:8000/admin/admin/logout/ (duplicate admin)

2009-05-19 Thread Jesse
Thanks! I'm in the middle of reloading everything again, because I thought it was something I had done. Good to know that wasn't the case and glad they are working on it. Thanks, again! On May 19, 11:11 am, Reiner wrote: > I stumbled across this bug too some days ago, it is already known and >

Re: Question: What's the best way to denormalize M2M data?

2009-05-19 Thread Ben Welsh
I'm imagining some pretty simple that would capture the M2M relationship, like this slightly modified one from the Django docs models: http://www.djangoproject.com/documentation/models/many_to_many/ picklefield: http://www.djangosnippets.org/snippets/513/ from django.db import models from utils.

Re: http://127.0.0.1:8000/admin/admin/logout/ (duplicate admin)

2009-05-19 Thread Reiner
I stumbled across this bug too some days ago, it is already known and being worked on, it is one of the tickets that need to be fixed in order to ship django 1.1. http://code.djangoproject.com/ticket/10061 If you need a quick fix, have a look at the comment by carljm: http://code.djangoproject.c

RE: Dynamic ForeignKey using or how ?

2009-05-19 Thread Will Matos
You can use model inheritance class SomeCommonNameHere(models.Model): title = models.CharField(max_length=100) body = models.TextField() class Casts(SomeCommonNameHere): somecastfield = models class Articles(SomeCommonNameHere): somearticlefield = models... class Fa

Re: Django version

2009-05-19 Thread Zain Memon
import djangodjango.get_version() On Tue, May 19, 2009 at 10:47 AM, VidrSan wrote: > > How can I see django version on my web-server? Just python's code, > beaucause I can't find any information on hosting > > > > --~--~-~--~~~---~--~~ You received this message b

http://127.0.0.1:8000/admin/admin/logout/ (duplicate admin)

2009-05-19 Thread Jesse
I'm setting up a new server with Apache/mod_python on windows. I can see my data on the admin page, but when I log out it is logging out with two admin/admin and I get an error page not found. I cannot figure out why this is happening? Thx --~--~-~--~~~---~--~~ Yo

Django version

2009-05-19 Thread VidrSan
How can I see django version on my web-server? Just python's code, beaucause I can't find any information on hosting --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Admin formating for inline, fieldsets don't work?

2009-05-19 Thread Keith Pettit
In the admin pages I'm using a parent that can have multiple child objects. For display I'm using inlines in my admin.py. The parent displays fine and the child displays fine using inlines but I can't seem to find out a way to control the formating of the inline child objects. This is a example

Re: MultiValueField with required=True problem

2009-05-19 Thread [CPR]-AL.exe
It is required On 19 май, 08:05, Thierry wrote: > Isn't required the default behaviour of Field: > > http://docs.djangoproject.com/en/dev/ref/forms/fields/ > > From the above code, TextInput is required: > > forms.TextInput(), > > On May 18, 1:15 pm, "[CPR]-AL.exe" wrote: > > > class CheckboxSe

Re: Question: What's the best way to denormalize M2M data?

2009-05-19 Thread George Song
On 5/19/2009 9:47 AM, Ben Welsh wrote: > On Tue, May 19, 2009 at 12:18 AM, George Song > wrote: > > > You can always explicitly define the m2m model, then you can override > the save() on that model if you like, or use signals like any other > model. > >

Re: Question: What's the best way to denormalize M2M data?

2009-05-19 Thread Ben Welsh
On Tue, May 19, 2009 at 12:18 AM, George Song wrote: > > You can always explicitly define the m2m model, then you can override > the save() on that model if you like, or use signals like any other model. > > Perhaps I've fumbled my way past the obvious, but the problem I'm running into with that

Re: upload_to usage

2009-05-19 Thread Alex Rades
On Tue, May 12, 2009 at 1:02 PM, Alex Gaynor wrote: > The reason the model isn't saved at thie point is because Django stores the > path to the file in the DB.  This means it has to know the path to the file > in order to save it.  However, you want it to save it in order to construct > the path

Re: additional data on ManyToManyField and symmetrical

2009-05-19 Thread Alex Rades
On Mon, May 18, 2009 at 2:13 AM, Russell Keith-Magee wrote: > When you have a symmetrical m2m relation to self, Django needs to > store 2 rows in the m2m table to fully represent the relation - that > is, when you store a 'friendship' between Alice and Bob, Django stores > the relationship (alic

Re: Oracle and Primary Keys

2009-05-19 Thread Tim Sawyer
On Tuesday 19 May 2009 16:20:58 Karen Tracey wrote: > On Tue, May 19, 2009 at 10:51 AM, Tim Sawyer wrote: > > It hasn't created a sequence/trigger for the primary key. Why is this? > > It does work for tables that have an implicit primary key (ie not > > specified in the > > model.) > > I'd gues

Re: Separate User namespace

2009-05-19 Thread Aneesh
How many private users do you have? If it's just a small number, consider using the same model for all Users, and making some profiles public/private. A couple usernames will be taken, but that shouldn't be a big deal. If you actually want a second namespace, I'm not sure of the best way to pro

Re: Oracle and Primary Keys

2009-05-19 Thread Karen Tracey
On Tue, May 19, 2009 at 10:51 AM, Tim Sawyer wrote: > > Hi, > > I have a django model that looks like this: > > class Lender(models.Model): >id = models.IntegerField(primary_key=True, db_column='lse_serial') >version = models.IntegerField(db_column='lse_version') >name = models.CharFie

Re: Parsing the arguments in HTTP GET

2009-05-19 Thread Andrew Ingram
I've used the forms framework with GET (I'm using it for a search form and a 'q' parameter), but it never occurred to me to use it to validate non-form parameters. Thanks! - Andrew Ingram 2009/5/19 Russell Keith-Magee : > > On Tue, May 19, 2009 at 10:38 PM, Andrew Ingram wrote: >> >> This is t

Oracle and Primary Keys

2009-05-19 Thread Tim Sawyer
Hi, I have a django model that looks like this: class Lender(models.Model): id = models.IntegerField(primary_key=True, db_column='lse_serial') version = models.IntegerField(db_column='lse_version') name = models.CharField(max_length=50, db_column='lse_lender') uri = models.TextFi

Re: Parsing the arguments in HTTP GET

2009-05-19 Thread Russell Keith-Magee
On Tue, May 19, 2009 at 10:38 PM, Andrew Ingram wrote: > > This is the only real way to do this with Django, though I do wish > there was a core Django way to validate GET params, ie which ones are > allowed and what format they should be. You mean, something like the Forms framework? :-) Ordin

Re: Restricting fields to certain users in admin

2009-05-19 Thread Matias Surdi
Matias Surdi escribió: > I need to hide a couple fields from a model depending on the logged in > user in the admin interface. > > How would you do this? > > > > > Replying to myself, here is the solution: class LimitedCustomUserAdmin(UserAdmin): inlines = [ProfileAdmin] form

Re: MultiValueField with required=True problem

2009-05-19 Thread [CPR]-AL.exe
And so? I don't get you. How can i requere that the user will select a checkbox OR input some text in TextInput? 2009/5/19 Thierry > Isn't required the default behaviour of Field: > > http://docs.djangoproject.com/en/dev/ref/forms/fields/ > > From the above code, TextInput is required: > > forms

Re: Parsing the arguments in HTTP GET

2009-05-19 Thread Andrew Ingram
This is the only real way to do this with Django, though I do wish there was a core Django way to validate GET params, ie which ones are allowed and what format they should be. - Andrew Ingram 2009/5/19 Will Matos : > > You wouldn't match this using a url pattern.  The rest of the query > string

RE: Need help for nested list in template

2009-05-19 Thread Will Matos
In this case a dictionary would not be necessary if he is indeed adding the model object itself: > user_status_list = UserStatus.objects.filter(id =20,time__gte > = somelist[val], time__lte = somelist[val+1)) > for item in user_status_list: >testing_list.append(item

RE: Parsing the arguments in HTTP GET

2009-05-19 Thread Will Matos
You wouldn't match this using a url pattern. The rest of the query string will be in the request.GET list. So you can do the following: ui=request.GET['ui'] shva=request.GET['shva'] name=request.GET['name'] you'll probably want to check that it exists first by doing: if 'ui' in request.GET:

Re: Need help for nested list in template

2009-05-19 Thread Tom Evans
On Tue, 2009-05-19 at 06:46 -0700, laspal wrote: > Hi, > My model is : >id val msg >20 1234 text >20 1245text >20 1275

RE: Need help for nested list in template

2009-05-19 Thread Will Matos
{%for item in final_list%} {%for val in item%} {{val.id}}, {{val.val}}, {{val.msg}} {%endfor%} {%endfor%} -Original Message- From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of laspal Sent: Tuesday, May 19, 2009 9:47 AM To: D

Re: Many-to-one relations on the "one" side admin form

2009-05-19 Thread diogobaeder
Thanks a lot, Alex! That's exactly what I needed! :-) Diogo On May 19, 12:13 am, Alex Gaynor wrote: > On Mon, May 18, 2009 at 10:12 PM, Diogo Baeder wrote: > > > Hi, guys, > > > Is there any way to put a repeatable field (say, many phones) in an admin > > form (say, a person)? This way a Pers

Re: Form Wizard and Saving to Database

2009-05-19 Thread geraldcor
So that's how that works. Brilliant. Thank you. It worked perfectly. On May 19, 1:43 am, George Song wrote: > On 5/18/2009 4:01 PM, geraldcor wrote: > > > Hello all, > > > I am working on my second Django app and it involves a very long form. > > I successfully used modelForms in my last app to

Need help for nested list in template

2009-05-19 Thread laspal
Hi, My model is : id val msg 20 1234 text 20 1245text 20 1275 text 20 1356 t

Re: help on outlook integration

2009-05-19 Thread Karen Tracey
On Tue, May 19, 2009 at 8:54 AM, Chris Withers wrote: > > kam wrote: > > We have to integrate of web outlook using HTTP protocol. We are > > trying to connect outlook with form based authentication to connect > > using HTTP protocol. We are able to connect outlook using HTTPS and > > COM object b

Re: model form validation always failing

2009-05-19 Thread Karen Tracey
On Tue, May 19, 2009 at 5:23 AM, watad wrote: > i have a model Career > > class Career(models.Model): > full_name = models.CharField(max_length=200) > email = models.EmailField() > nationality = CountryField() > resume = models.FileField(upload_to='resumes') > def __unicode__(self): >

Re: ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-19 Thread Alex Gaynor
On Tue, May 19, 2009 at 8:16 AM, Karen Tracey wrote: > On Tue, May 19, 2009 at 12:15 AM, Margie wrote: > >> >> I tried using raw_id_fields in admin for the first time (using the >> Django 1.1 beta). When I click search gif I find that it tries to >> redirect me to: >> >> http://mysite.com/auth/

Re: ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-19 Thread Karen Tracey
On Tue, May 19, 2009 at 12:15 AM, Margie wrote: > > I tried using raw_id_fields in admin for the first time (using the > Django 1.1 beta). When I click search gif I find that it tries to > redirect me to: > > http://mysite.com/auth/user/?t=id > > Seems to me it should be redirecting me to this i

Re: help on outlook integration

2009-05-19 Thread Chris Withers
kam wrote: > We have to integrate of web outlook using HTTP protocol. We are > trying to connect outlook with form based authentication to connect > using HTTP protocol. We are able to connect outlook using HTTPS and > COM object but this is not work on Linux & using COM object we are > able to a

help on outlook integration

2009-05-19 Thread kamlesh . ldce
Hi All, We have to integrate of web outlook using HTTP protocol. We are trying to connect outlook with form based authentication to connect using HTTP protocol. We are able to connect outlook using HTTPS and COM object but this is not work on Linux . We are expecting header cookie and response d

help on outlook integration

2009-05-19 Thread kam
Hi All, We have to integrate of web outlook using HTTP protocol. We are trying to connect outlook with form based authentication to connect using HTTP protocol. We are able to connect outlook using HTTPS and COM object but this is not work on Linux & using COM object we are able to access only

help on outlook integration

2009-05-19 Thread kamlesh . ldce
Hi All, We have to integrate web outlook using HTTP protocol. We are trying to connect outlook with form based authentication to connect using HTTP protocol. We are able to connect outlook using HTTPS and COM object but this is not work on Linux & using COM object. We are expecting header cooki

Re: Passing a dynamic ChoiceField response to a ForeignKey instance

2009-05-19 Thread Simon Greenwood
On May 18, 3:32 pm, Simon Greenwood wrote: > On May 18, 12:02 pm, Simon Greenwood wrote: > > > > > On May 15, 5:58 pm, simong wrote: > > > > There's probably a very simple answer to this but I can't see it at > > > the moment: > > > > This model: > > > > class Product(models.Model): > > >    

Re: Help on query

2009-05-19 Thread Daniel Roseman
On May 19, 12:11 pm, Lokesh wrote: > class Users(models.Model): >     userId = models.IntegerField(max_length=2, primary_key=True) >     userName = models.CharField(max_length=10, null=False, > blank=False) > >     def __unicode__(self): >         return self.userName > > class MotherTongue(model

Re: model form validation always failing

2009-05-19 Thread watad
thanks for the reply thomas if tried that but it is still giving the validation message On May 19, 1:18 pm, Thomas Guettler wrote: > Maybe you form misses this: enctype="multipart/form-data" > > watad schrieb: > > > dear all > ... > > i can see the fileds but when i try to submit , the rusume va

Re: Dynamic ForeignKey using or how ?

2009-05-19 Thread Michael Radziej
On Tue, May 19, Anakin wrote: > class Faves(models.Model): > post = models.ForeignKey(CASTS-OR-ARTICLES) > user = models.ForeignKey(User,unique=True) > > is it possible ? You might want to use "generic relations" for this. They are described in the contenttypes framework. Hope

Restricting fields to certain users in admin

2009-05-19 Thread Matias Surdi
I need to hide a couple fields from a model depending on the logged in user in the admin interface. How would you do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Help on query

2009-05-19 Thread Lokesh
class Users(models.Model): userId = models.IntegerField(max_length=2, primary_key=True) userName = models.CharField(max_length=10, null=False, blank=False) def __unicode__(self): return self.userName class MotherTongue(models.Model): MT_id = models.IntegerField(max_length

Re: model form validation always failing

2009-05-19 Thread Thomas Guettler
Maybe you form misses this: enctype="multipart/form-data" watad schrieb: > dear all ... > i can see the fileds but when i try to submit , the rusume validation > is always failing (This field is required.) > although i upload the file, and i was able to add data usign the admin > interface witho

model form validation always failing

2009-05-19 Thread watad
dear all i have a model Career class Career(models.Model): full_name = models.CharField(max_length=200) email = models.EmailField() nationality = CountryField() resume = models.FileField(upload_to='resumes') def __unicode__(self): return self.full_name and i have the model fo

preferred/correct way to modify imagefields

2009-05-19 Thread ozgurisil
Hello all, I have spent considerable time going through the documentation but have been unable to find clear information about how to save an image after uploading it via a form. I think I have somehow missed it. After trial and error, I have done it in this way: content = request.FILES['ima

Dynamic ForeignKey using or how ?

2009-05-19 Thread Anakin
i want to use 2 model in one foreignkey, i think its dynamic foreignkey it means; i have 2 model named screencasts and articles. and i have a fave model, for favouriting this model entrys. can i use model dynamicly ? class Articles(models.Model): title = models.CharField(max_length=100)

Re: crossdomain.xml

2009-05-19 Thread Matt Davies
I got it Thanks for your help James 2009/5/19 Matt Davies > Thanks James > I'm serving the sites with nginx, but in my django urls file I'm using this > line for a simple pages app we've built. > > urlpatterns += patterns('fact.pages.views', > (r'^(?P.*)$', 'page'), > ) > > What happens is

Re: crossdomain.xml

2009-05-19 Thread Matt Davies
Thanks James I'm serving the sites with nginx, but in my django urls file I'm using this line for a simple pages app we've built. urlpatterns += patterns('fact.pages.views', (r'^(?P.*)$', 'page'), ) What happens is that whatever you put into the URL the pages app will try and serve it. So wh

Re: crossdomain.xml

2009-05-19 Thread James Bennett
On Tue, May 19, 2009 at 2:47 AM, Matt Davies wrote: > I've been asked to server up a crossdomain.xml file at the root of our web > sites so that another team of developers can access our data via Flash. > How do I set that up in the urls.py file?  I use one urls.py file for many > web sites so it

  1   2   >