If Statements inside For Loops

2010-01-10 Thread Dave Merwin
I have the following: {% for group in user.groups.all %} {{ group.name }} {% ifequal group.name "subscribed" %} I'm subscribed {% else %} {{ group.name }} {% endifequal %} {% endfor %} The else part of the statement is not rendering. What am I missing? Any help wel

Re: Model Form crashing on Foreign Key

2010-01-10 Thread fest
I feel like I could jump out of the window... Just spent 4 hours of debugging :/ Any idea which is the last revision which is not affected by this bug? On 11 Janv., 07:02, Sontek wrote: > On Jan 10, 6:17 pm, Sontek wrote: > > > On Jan 10, 12:23 pm, Sontek wrote: > > > > So I'm trying to cre

Re: Model Form crashing on Foreign Key

2010-01-10 Thread Sontek
On Jan 10, 6:17 pm, Sontek wrote: > On Jan 10, 12:23 pm, Sontek wrote: > > > So I'm trying to create a new feed within the Admin page and its > > crashing with the error  IntegrityError: lifestream_feed.lifestream_id > > may not be NULL, the call stack is... form['lifestream'] is set but > > fo

Form Validation in Admin

2010-01-10 Thread Sasuke
Hi all, I'm using the form's clean() method to do validation for models in admin. The validation we need to do is to make sure there are no more than a certain number of items totally submitted. So I calculate the total number of items in the clean() method and check whether it is in the given r

Re: django-tagging on shared hosting

2010-01-10 Thread flynnguy
Awesome, worked like a charm, Thank you! You know, I *thought* I tried this but I think I didn't do something right in importing the paths before so when I read it I thought well let me try it once more. I was also half asleap last night trying to get it to work... I should learn that coding while

World cities database

2010-01-10 Thread nameless
Hi at all, I need a world cities database for registration form. What is the best and most used ? thanks ^_^ -- 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

Inline Admin and ForeignKey

2010-01-10 Thread Igor
Hi, I have a blog model and would like to be able to add an arbitrary number of event dates to it (i.e. turn a blog post into an event announcement). For that I use class Event(models.Model): entry = models.ForeignKey(Entry) begin_date = models.DateTimeField(default=datetime.datetime.now)

Re: Model Form crashing on Foreign Key

2010-01-10 Thread Sontek
On Jan 10, 12:23 pm, Sontek wrote: > So I'm trying to create a new feed within the Admin page and its > crashing with the error  IntegrityError: lifestream_feed.lifestream_id > may not be NULL, the call stack is... form['lifestream'] is set but > form.instance.lifestream is not.  Here is the code

Django with embedded python - module error

2010-01-10 Thread Wim De Hul
Dear members, I'm trying to use Django in an embedded python app (main program is in C). When I try to import the models from my Django app, I get the following error: Traceback (most recent call last): File "/data/mytest/test.py", line 4, in from accounts import models File "/data/dj/ac

Re: multidb - partitioning

2010-01-10 Thread Adrian Maier
On Sat, Jan 9, 2010 at 15:20, tom wrote: > Hi Adrian, > > thanks for your answer! > The problem is, that i don't know how many projects will be created. > Every user > of the application can create and delete new projects. > Maybe it's possible to execute some raw sql commands whenever a > projec

Re: Possibility of recursive rendering

2010-01-10 Thread Ethan Jucovy
I think the easiest thing to do write two templates and use the {% include %} tag like so: # templates/number_of_comments.html There are {{paragraph.comment_set.all.count}} comments. # templates/display_all_paragraphs.html {% for paragraph in paragraph_set %} Paragraph: {{paragraph.name}} {% incl

Re: Handling Vector/Array Data in Forms

2010-01-10 Thread Frédéric Burlet
On Saturday 09 January 2010 17:17:26 Tomasz Zieliński wrote: > On 9 Sty, 01:23, datta wrote: > > I am using Django for a scientific applicaition. If I have to > > transport a vector/array 'to' a form, dismantle it and display the > > relevant information, it is easy. But how I capture vectors/arra

Re: handle astronomically high number of users via the new BigIntegerField and contrib.auth.user

2010-01-10 Thread Eric Chamberlain
We used one of the UUID fields from djangosnippets.org . On Jan 9, 2010, at 6:56 PM, G B Smith wrote: > Eric, could you explain how this UUID implementation was achieved? > Django doesn't have a built-in UUID, so I can only guess that you used > a v

Re: Additional field in junction table

2010-01-10 Thread Benjamin W.
Guess I had some potatoes on my eyes. Thank you! On Jan 10, 7:24 pm, Daniel Roseman wrote: > On Jan 10, 5:48 pm, "Benjamin W." wrote: > > > Hi, > > > I have a model with a ManyToManyField. > > The junction table ist automatically created by django. > > In my application it is needed to save addi

Model Form crashing on Foreign Key

2010-01-10 Thread Sontek
So I'm trying to create a new feed within the Admin page and its crashing with the error IntegrityError: lifestream_feed.lifestream_id may not be NULL, the call stack is... form['lifestream'] is set but form.instance.lifestream is not. Here is the code: class FeedCreationForm(forms.ModelForm):

Re: Additional field in junction table

2010-01-10 Thread Daniel Roseman
On Jan 10, 5:48 pm, "Benjamin W." wrote: > Hi, > > I have a model with a ManyToManyField. > The junction table ist automatically created by django. > In my application it is needed to save additional information for > every relation that is created, so I would need an additional field in > the jun

Re: Register signal on all objects

2010-01-10 Thread Matias
El 10/01/10 04:18, Ishwor Gurung escribió: 2010/1/10 Matias: [...] Thanks, this will do the trick... Curious. Why doesn't overriding save(..) do for you? Because I would have to override the save() method on all Model classes -- You received this message because you are subscribed to the

Additional field in junction table

2010-01-10 Thread Benjamin W.
Hi, I have a model with a ManyToManyField. The junction table ist automatically created by django. In my application it is needed to save additional information for every relation that is created, so I would need an additional field in the junction table. It's difficult to explan, so I've created

Re: Why in import statement

2010-01-10 Thread Łukasz Balcerzak
Hi there, Well, it is quite simple but let's break it down: > to me the command "from myproject.myapp.models import Author" should > be > either > >from myapp.models import Author > or >from models import Author # in the same folder as myapp.models. 1) If you use "from myapp.models imp

Re: django-tagging on shared hosting

2010-01-10 Thread Daniel Roseman
On Jan 10, 3:28 pm, flynnguy wrote: > So I'm trying to implement tagging on my website and I found the > django-tagging project and threw it in my app and it works great... on > my laptop. Go to put things up on the server (dreamhost using their > new passenger method) and started to run into some

django-tagging on shared hosting

2010-01-10 Thread flynnguy
So I'm trying to implement tagging on my website and I found the django-tagging project and threw it in my app and it works great... on my laptop. Go to put things up on the server (dreamhost using their new passenger method) and started to run into some issues. I did easy install using --prefix so

Re: installing django application on non-django website.

2010-01-10 Thread flynnguy
It looks like what you've linked to is a full project. In order to use any part of Django, you need to setup a Django instance. You will need to go configure apache to pass requests going to example.com/weblog/ to Django, specifically your project folder. The url.py folder then handles the rest. -

Why in import statement

2010-01-10 Thread ruckus tak
Hi, + + Does anyone know why the project-name included in the import statement? +---

installing django application on non-django website.

2010-01-10 Thread gryzzly
I have a website that is a bunch of html files, deployed trhough apache. (let's say, example.com) What do I need to do in order to deploy one django application (let's say http://github.com/vbabiy/django_blog) on example.com/weblog/? I know how to plug an application into existing django project,

Re: handle astronomically high number of users via the new BigIntegerField and contrib.auth.user

2010-01-10 Thread Frank DiRocco
I assume you could checksum some form of the user's object or "cleaned" form values and store it as unique attribute of the users. You would prolly have to override the clean method and add in valudation of the uniqueness and generate using an alternate method if the first does not validate

text in translation strings?

2010-01-10 Thread Andreas Pfrengle
Hello, I'm having a template, where a link shall be inside a translation- marked text. I see two ways how to accomplish this, but both don't work: 1. {% trans "You need to login before you can do anything" %} I get an template syntax error: "Searching for value. Unexpected end of string" (beca

Re: Possibility of recursive rendering

2010-01-10 Thread Andreas Pfrengle
On 10 Jan., 10:42, Amit Sethi wrote: > Hi I wish  to know if it is possible to use recursive rendering ? . What I > mean by that is that their is a template which renders no of comments on a > paragraph . SInce their are many paragraphs what i wish to send is  a list > of render_to_response calls

Re: users sessions logging

2010-01-10 Thread Казбек
In this case request.session.session_key and request.COOKIES ["sessionid"] contains different values. request.COOKIES["sessionid"] contains old session id, request.session.session_key contains new session id. To emplement correct logging, need to find session id from request.COOKIES["sessionid"] in

Re: Django Groups In Templates

2010-01-10 Thread G B Smith
If your users can belong to only one group, then check this out: - http://stackoverflow.com/questions/1889607/django-middleware-to-determine-users-group-in-a-session GBS. On Jan 10, 1:21 pm, Dave Merwin wrote: > Brilliant!! That worked. Thanks. > > On Jan 10, 12:19 am, G B Smith wrote: > > > us

Re: context processor var empty

2010-01-10 Thread Daniel Roseman
On Jan 10, 3:35 am, neridaj wrote: > I'm trying to use a context processor to make all of my blog entry > titles available for an ajax autocomplete search box but for some > reason the var returned from the context processor is empty. > > from blog.models import Entry > > # search/context_processo

Possibility of recursive rendering

2010-01-10 Thread Amit Sethi
Hi I wish to know if it is possible to use recursive rendering ? . What I mean by that is that their is a template which renders no of comments on a paragraph . SInce their are many paragraphs what i wish to send is a list of render_to_response calls for each paragraph. i.e send response messages

Re: Django Groups In Templates

2010-01-10 Thread Dave Merwin
Brilliant!! That worked. Thanks. On Jan 10, 12:19 am, G B Smith wrote: > user.groups.all returns not one but (possibly) many objects. Thus you > will have to do something like > > {% for group in user.groups.all %} >     {% if group.name == 'subscribed' %} >        Hello >     {% endif %} > {% en

Re: Django Groups In Templates

2010-01-10 Thread G B Smith
user.groups.all returns not one but (possibly) many objects. Thus you will have to do something like {% for group in user.groups.all %} {% if group.name == 'subscribed' %} Hello {% endif %} {% endfor %} Regards, GBS On Jan 10, 1:12 pm, Dave Merwin wrote: > I'm trying to do somet

Django Groups In Templates

2010-01-10 Thread Dave Merwin
I'm trying to do something I thought was simple. {% ifequal user.groups "subscribed" %} Hello {% endifequal %} But it's not working... Any tips? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u