Re: Using a template variable in the "include" template tag

2010-01-29 Thread Super McFly
I store the model name as a field in the "Content" class. I then added def include_template(self): return"content/" + self.content_type.lower() + "/include.html" to the model. Then in the template I used {% for content in content_list %} {% include content.include_template %} {%

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Eric Abrahamsen
On Jan 30, 2010, at 2:07 PM, Super McFly wrote: Thanks for your suggestion, Eric. I actually tried that but for some reason it didn't work so I assumed it was the same problem. It turns out it does work so a big thank you to you and everyone else who tried to help. Good! Since you've already

a hook where request is available

2010-01-29 Thread Eric Abrahamsen
I've got a "NewContent" model which is essentially a tumblelog – when instances of certain models are created or saved, a NewContent instance is created that keeps track of them, and NewContent querysets are used to populate the index page, RSS feed, etc. Up until now I've been doing this i

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Super McFly
Thanks for your suggestion, Eric. I actually tried that but for some reason it didn't work so I assumed it was the same problem. It turns out it does work so a big thank you to you and everyone else who tried to help. On Jan 30, 5:59 am, Eric Abrahamsen wrote: > I've done this by including a pyth

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Super McFly
I had just responded to myself with that suggestion but I've deleted it to avoid repetition. I'll try to explain the bigger picture but it's a little tricky. There is a "Content" base model from which "Post", "Review", "Feature", e.t.c inherit. To get a list of the latest content for all types I h

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Eric Abrahamsen
I've done this by including a python-only attribute on the models themselves: include_template = "content/post/include.html" and in the template {% include content.include_template %} Provided that "content" is a model instance. You could even write a model mixin class that does this automat

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Super McFly
I guess the only way to do this would be to use an if conditional, which would be really ugly... {% if content.model_type == 'post' %} {% include "content/post/include.html" %} {% endif %} {% if content.model_type == 'review' %} {% include "content/review/include.html" %} {% endif %} O

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Sam Lai
You can always use if blocks, e.g. {% ifequal content.model_type "post" %} {% include "content/post/include.html" %} {% elseifequal ... %} ... {% endif %} What's the bigger picture for what you're trying to do? 2010/1/30 Super McFly : > Thank you for the reply. Do you have any suggestions on how

Re: Using a template variable in the "include" template tag

2010-01-29 Thread Super McFly
Thank you for the reply. Do you have any suggestions on how to do it my way? On Jan 30, 5:23 am, pyleaf wrote: > i think that will not work,because 'include' excutes before the Variable. > > On Sat, Jan 30, 2010 at 12:51 PM, Super McFly wrote: > > > > > Is it possible to use a template variable i

Re: Using a template variable in the "include" template tag

2010-01-29 Thread pyleaf
i think that will not work,because 'include' excutes before the Variable. On Sat, Jan 30, 2010 at 12:51 PM, Super McFly wrote: > Is it possible to use a template variable in the "include" template > tag. My actual problem is below... > > {% include "content/{{ content.model_type }}/include.html"

Re: REST & Django

2010-01-29 Thread pyleaf
oh,thanks. On Sat, Jan 30, 2010 at 12:44 AM, myfreeweb wrote: > REST is a web service architecture, not a program functionality. > If you want to implement a RESTful API for your app, take a look at > django-piston: http://bitbucket.org/jespern/django-piston/wiki/Home > > On 29 янв, 19:03, pylea

Using a template variable in the "include" template tag

2010-01-29 Thread Super McFly
Is it possible to use a template variable in the "include" template tag. My actual problem is below... {% include "content/{{ content.model_type }}/include.html" %} {{ content.model_type }} by itself outputs "post" and the full string outputs "content/post/include.html" and if that string is hard

'Reverse' (??) InlineModelAdmin objects

2010-01-29 Thread Rishabh Manocha
Hey guys, I've been trying to get InlineModelAdmin objects setup in my admin app, but am unable to figure out how to do so correctly. Using the same example as the one listed in the docs [1]: class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): autho

Re: svn checkout problems? (at around 2:50 pm GMT, 2010-01-29)

2010-01-29 Thread Kenneth Gonsalves
On Friday 29 Jan 2010 8:29:55 pm chefsmart wrote: > For the last 1 hour I have been trying to checkout a fresh copy of > django-trunk from svn. But the checkout is failing. Unfortunately, I > don't have the exact message I have been receiving, but just wondering > if anybody else facing similar is

Re: Division with Python/Django

2010-01-29 Thread Mike Ramirez
On Friday 29 January 2010 12:28:37 Chris McComas wrote: > Hey everyone, here's all of the information: > > Here's the models: > http://dpaste.com/152277/ > > Here's my view: > http://dpaste.com/152061/ > > Here's the full error message: > http://dpaste.com/152060/ > All your fields in the mode

Content Transfer Encoding in Emails

2010-01-29 Thread Stephen Sundell
How would I get my content transfer encoding for emails sent through the django emails system to be 7bit? Stephen -- 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

Django admin login failure

2010-01-29 Thread toinbis
Hi folks, logging into django admin fails when 'log in' button is pressed first time, but pressing "back" and "log in' again - logs the user in successfully. I am deploying Django app with zc.buildout here, with a setup similar to what is described here http://www.meppum.com/2009/jan/17/installi

Re: False negatives on model validation of CharField with choices

2010-01-29 Thread Thomas B. Higgins
Ramiro, great work on this! With your second patch I'm back in business - with optgroups! On a related matter, I don't often want a "blank" option when I use choices/selects. I've been setting default selections and eliminating the "blank" line as described on 11/07/07 by semenov in #4653 using a

Re: False negatives on model validation of CharField with choices

2010-01-29 Thread Thomas B. Higgins
Ramiro, great work on this! With your second patch I'm back in business - with optgroups! On a related matter, I don't often want a "blank" option when I use choices/selects. I've been setting default selections and eliminating the "blank" line as described on 11/07/07 by semenov in #4653 using a

Re: froms: extended labels

2010-01-29 Thread tom
to be specific. the view renders this form in the template Members*: test1 test2 test3 test4 test5 test6 test7 test8 test9 and I would like to have the option to get more information into so that there is not the text "test1" but the full name of the user, for

Re: Using the form field values in templates

2010-01-29 Thread Adrian Maier
Shawn, Ondrey, Thanks for your answers. I ended up using to ModelForm and ModelFormSet. Cheers, Adrian On Tue, Jan 19, 2010 at 16:12, ondrey wrote: > Hi, > > if the form is bound (i.e. form.is_bound is true) then you can access > its data attribute, which contains the data entered into the

Re: Division with Python/Django

2010-01-29 Thread Chris McComas
Hey everyone, here's all of the information: Here's the models: http://dpaste.com/152277/ Here's my view: http://dpaste.com/152061/ Here's the full error message: http://dpaste.com/152060/ On Jan 29, 9:13 am, Chris McComas wrote: > The form is a ModelForm, where the fields involved, all of th

Re: Models, forms and inlineformset

2010-01-29 Thread Stefan Nitsche
On Thu, Jan 28, 2010 at 10:15, andreas schmid wrote: > and your form works on edit too? > i really cant understand why mine isnt... > > its giving me this MultiValueDictKeyError which i dont understand. > > Stefan Nitsche wrote: > > On Wed, Jan 27, 2010 at 14:04, andreas schmid >

Re: Django Model Audit Log

2010-01-29 Thread Shawn Milochik
Awesome! Thanks, that does exactly what I need. Shawn On Jan 29, 2010, at 12:08 PM, tom wrote: > maybe that middleware can help you out with getting the username > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser -- You received this message because you are subscribed to the Goo

Re: REST & Django

2010-01-29 Thread myfreeweb
REST is a web service architecture, not a program functionality. If you want to implement a RESTful API for your app, take a look at django-piston: http://bitbucket.org/jespern/django-piston/wiki/Home On 29 янв, 19:03, pyleaf wrote: > how REST looks like in django? > does Django support REST defa

Re: Django Model Audit Log

2010-01-29 Thread Bill Freeman
This is much better than my ramblings. On Fri, Jan 29, 2010 at 12:08 PM, tom wrote: > maybe that middleware can help you out with getting the username > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > On 29 Jan., 18:05, Shawn Milochik wrote: >> I need to implement auditing for

Re: Django Model Audit Log

2010-01-29 Thread Bill Freeman
If worse comes to worst, you could always patch the url dispatcher to store the user in a global variable before it calls the view. It should be sure to set that variable to None when the view returns, so that the global doesn't keep a reference on the user object between requests (a try finally a

Re: Django Model Audit Log

2010-01-29 Thread tom
maybe that middleware can help you out with getting the username http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On 29 Jan., 18:05, Shawn Milochik wrote: > I need to implement auditing for my models. The current plan is to listen for > the post_save() signal and dump the current v

Re: Django 1.1 features covered in book.

2010-01-29 Thread Shawn Milochik
"The Definitive Guide to Django," Second Edition by Adrian Holovaty and Jacob Kaplan-Moss covers Django 1.1. I have a copy sitting on my desk right now. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Django Model Audit Log

2010-01-29 Thread Shawn Milochik
I need to implement auditing for my models. The current plan is to listen for the post_save() signal and dump the current values of the instance to an external database. The only problem is that I need to store the request.user with this data, and I don't see any way to capture that, since it

Re: Django 1.1 features covered in book.

2010-01-29 Thread Bill Freeman
Yes, but you can only read it on line. It's the 1.1 documentation and release notes at djangoproject.com . On Fri, Jan 29, 2010 at 9:49 AM, Sebastian Pawlus wrote: > Hi > Do you know any Django books which cover functionalities introduced by > version 1.1? > thanks > > -- > You received this mes

froms: extended labels

2010-01-29 Thread tom
Hi, I have a Model Form defined like that: class ProjectMemberForm(forms.ModelForm): """ Renders a form where users can be assigned to a project. The ``members`` are overidden and need to be populated in the view with: form = ProjectMemberForm() form.base_fields['m

Re: REST & Django

2010-01-29 Thread Malcolm Box
On Fri, Jan 29, 2010 at 4:03 PM, pyleaf wrote: > how REST looks like in django? > does Django support REST defautly? > > Django can be used to develop a REST API, it implements all the HTTP methods needed and Django views can easily generate JSON, XML or whatever you require. There's not much bu

REST & Django

2010-01-29 Thread pyleaf
how REST looks like in django? does Django support REST defautly? -- Believing is everythig! -- 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, sen

Re: read only django admin

2010-01-29 Thread aledr
On Fri, Jan 29, 2010 at 12:55 AM, zweb wrote: > Is it possible to have a read only django admin, ie user cannot add, > delete or update. User can only view data. > > or may be one user can be view only and other user has add/delete / > update as well in Django admin. > > How to do that? http://ww

Re: viewsite button takes me to example.com

2010-01-29 Thread Mario
You need to login to your admin and scroll down the Sites and change the example.com to your domain name or IP address. Cheers. On Jan 29, 10:50 am, harryos wrote: > hi > I was trying out the weblog app in bennet's book.I created some > categories and entries and can list them properly > usin

viewsite button takes me to example.com

2010-01-29 Thread harryos
hi I was trying out the weblog app in bennet's book.I created some categories and entries and can list them properly using http://127.0.0.1:8000/myblog/ and http://127.0.0.1:8000/myblog/categories The admin interface also lists the categories properly when I try http://127.0.0.1:8000/admin/myblog

Re: svn checkout problems? (at around 2:50 pm GMT, 2010-01-29)

2010-01-29 Thread chefsmart
No my svn checkout command was ok, as was the url in that command. To elaborate, svn would continue with checkout then abruptly stop at a random file. I tried it about 3 or 4 times with the same result. Regards. On Jan 29, 8:27 pm, Daniel Hilton wrote: > On 29 January 2010 14:59, chefsmart wrot

Re: svn checkout problems? (at around 2:50 pm GMT, 2010-01-29)

2010-01-29 Thread Daniel Hilton
On 29 January 2010 14:59, chefsmart wrote: > For the last 1 hour I have been trying to checkout a fresh copy of > django-trunk from svn. But the checkout is failing.  Unfortunately, I > don't have the exact message I have been receiving, but just wondering > if anybody else facing similar issues w

Re: Dealing with polyhierarchical data

2010-01-29 Thread Olivier Guilyardi
On 01/28/2010 11:12 AM, Matthias Kestenholz wrote: > Hi > > On Wed, Jan 27, 2010 at 11:29 PM, Olivier Guilyardi wrote: >> Hi, >> >> I'm working with a polyhierarchical thesaurus, and trying to handle that in >> Django. By polyhierarchical, I mean : nodes can have both multiple parents >> and >>

svn checkout problems? (at around 2:50 pm GMT, 2010-01-29)

2010-01-29 Thread chefsmart
For the last 1 hour I have been trying to checkout a fresh copy of django-trunk from svn. But the checkout is failing. Unfortunately, I don't have the exact message I have been receiving, but just wondering if anybody else facing similar issues with checkout? Regards. -- You received this messa

Re: What's the going rate for a Django developer?

2010-01-29 Thread thanos
In new York I know a few consultants at $1100/day - and that rate is confirmed. On Jan 29, 9:16 am, Dougal Matthews wrote: > I think the answer to that is probably "it depends". > >    1. Permanent or contractor? >    2. What country? >    3. Often it even matters what city? >    4. How much expe

Django 1.1 features covered in book.

2010-01-29 Thread Sebastian Pawlus
Hi Do you know any Django books which cover functionalities introduced by version 1.1? 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 this group, s

Re: read only django admin

2010-01-29 Thread Alex Robbins
It sounds like the databrowse[1] contrib app may be what you are looking for. It is basically a read-only admin. You'll have to register classes with it the same way you register with the admin, but it might be nicer than trying to force the admin to be read-only. Hope that helps, Alex [1] http:/

Re: Database performance during test execution

2010-01-29 Thread Russell Keith-Magee
On Fri, Jan 29, 2010 at 10:38 PM, Sebastian Pawlus wrote: > Thanks Russell, your answer was more than helpful. It really worked for me. > There were some problems on Django 1.0 but after that (1.1 and up) every > thing looks good. Performance of database looks much better right now. > I'm also wan

Re: Database performance during test execution

2010-01-29 Thread Sebastian Pawlus
Thanks Russell, your answer was more than helpful. It really worked for me. There were some problems on Django 1.0 but after that (1.1 and up) every thing looks good. Performance of database looks much better right now. I'm also wandering if that issue is well enough explained in Django docs? On

Re: What's the going rate for a Django developer?

2010-01-29 Thread Dougal Matthews
I think the answer to that is probably "it depends". 1. Permanent or contractor? 2. What country? 3. Often it even matters what city? 4. How much experience do they have? It's probably best for you to look at job adverts and see what they are offering. Some listings on http://djangogi

Re: Division with Python/Django

2010-01-29 Thread Chris McComas
The form is a ModelForm, where the fields involved, all of them are DecimalField() On Jan 29, 9:03 am, Chris McComas wrote: > Changed my view to this: > > http://dpaste.com/152061/ > > This is the full error message: > > http://dpaste.com/152060/ > > The first three numbers, math_rawscore, scien

Re: Division with Python/Django

2010-01-29 Thread Chris McComas
Changed my view to this: http://dpaste.com/152061/ This is the full error message: http://dpaste.com/152060/ The first three numbers, math_rawscore, science_rawscore, and socsci_rawscore are GPAs, like 4.0, 3.47, etc. The second two numbers pcat_rawscore and pcatessay_rawscore are whole numbers

Re: Division with Python/Django

2010-01-29 Thread Mike Ramirez
On Friday 29 January 2010 05:40:19 Chris McComas wrote: > I have this view with my form: http://dpaste.com/152046/ when I try to > submit the form I'm getting this error: unsupported operand type(s) > for //: 'unicode' and 'int' what did I do wrong? > A full traceback would be helpful, along with

Re: manytomany relations

2010-01-29 Thread CCC
I mean the users who have the number of group is the lagest ten. and the relation is manytomany.thanks On 1月29日, 下午8时05分, Stodge wrote: > I think he needs to read the tutorial: > > http://docs.djangoproject.com/en/1.1/intro/tutorial03/#write-views-th... > > And I quote: > > "Here's one stab at th

Re: manytomany relations

2010-01-29 Thread CCC
I mean the users who have the number of group is the largest ten and you see the relation is manytomany. On 1月29日, 下午8时05分, Stodge wrote: > I think he needs to read the tutorial: > > http://docs.djangoproject.com/en/1.1/intro/tutorial03/#write-views-th... > > And I quote: > > "Here's one stab at

Re: Division with Python/Django

2010-01-29 Thread rebus_
On 29 January 2010 14:40, Chris McComas wrote: > I have this view with my form: http://dpaste.com/152046/ when I try to > submit the form I'm getting this error: unsupported operand type(s) > for //: 'unicode' and 'int' what did I do wrong? > > -- > You received this message because you are subscr

Re: ForeignKey query

2010-01-29 Thread mates fila
Hi, try this: ** resultList = list( set(modelList) & set(Model1.objects.filter(model2__pk__isnull = False).distinct ()) ) ** or this: ** resultList = list( set(modelList) & set([m.model1 for m in Model2.objects.all()])

Re: Load template tags if installed?

2010-01-29 Thread trójkąt
On 18 Sty, 02:48, "Aaron C. de Bruyn" wrote: > I dove into django/template/defaulttags.py to figure out how the 'if' > tag works, and I came up with this solution. And do you have any solution for something like this: {% ifloaded my_app %} {% tag_from_my_app %} {% endifloaded %} ? -- You

What's the going rate for a Django developer?

2010-01-29 Thread Astley Le Jasper
Any ideas? -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this

Division with Python/Django

2010-01-29 Thread Chris McComas
I have this view with my form: http://dpaste.com/152046/ when I try to submit the form I'm getting this error: unsupported operand type(s) for //: 'unicode' and 'int' what did I do wrong? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: False negatives on model validation of CharField with choices

2010-01-29 Thread Ramiro Morales
On Thu, Jan 28, 2010 at 2:46 PM, Thomas B. Higgins wrote: > I've done some further checking, and see that this issue has two > parts. The first part is certainly a bug. Basically, selects with > optgroups are broken. Here's the ticket: > http://code.djangoproject.com/ticket/12722. Sorry I didn't

Django reporting....

2010-01-29 Thread Rick Caudill
Hi everyone, I have been working on a Django reporting tool for the company I work for and wonder if anyone thinks a reporting tool like attached would be valuable to the community??? I should say that it doesn't handle m2m yet but I am working on that. I would also want to clean the code up som

Re: customize form in template according to field attribute

2010-01-29 Thread jul
I meant: "to be able to separate those having different type in my CSS. " On Jan 29, 12:56 pm, jul wrote: > hi, > > I've got the Category model and SearchForm form shown below. In my > template I'd like to get all Category instances having a given type to > be able to separate those having differ

Re: popup forms

2010-01-29 Thread Bhaskar Gara
That where I stuck.. I am new to Django so I confuse where to add what? what name i need to give to the widget,form etc., Can you please help me. Thank you Bhaskar On Jan 29, 1:45 am, andreas schmid wrote: > hi, yes it works perfectly :) > > follow the steps on the turorial here > > http://www.

Re: manytomany relations

2010-01-29 Thread Stodge
I think he needs to read the tutorial: http://docs.djangoproject.com/en/1.1/intro/tutorial03/#write-views-that-actually-do-something And I quote: "Here's one stab at the index() view, which displays the latest 5 poll questions in the system" On Jan 29, 4:57 am, Wayne Koorts wrote: > What d

Re: redirect question

2010-01-29 Thread bastir
Sry. Just found it out. If it is in the view it must be : app_name.view.function_name as you said. I tried it with prog_name.app_name which does not work. Thank you very much bastir On 29 Jan., 11:27, bastir wrote: > Hello Atamert, > > thanks for your quick reply. It seems that it now finds th

customize form in template according to field attribute

2010-01-29 Thread jul
hi, I've got the Category model and SearchForm form shown below. In my template I'd like to get all Category instances having a given type to be able to separate those having different style in my CSS. How can I do this? thanks Jul **Category model*** CATEGORY_TYPE = [ (1, 'region'), (2,

Re: redirect question

2010-01-29 Thread bastir
Hello Atamert, thanks for your quick reply. It seems that it now finds the function but still does not work: Reverse for '' with arguments '()' and keyword arguments '{'s_id': 1}' not found. Greetings bastir On 29 Jan., 11:19, Atamert Ölçgen wrote: > Hi Bastir, > > On Friday 29 January 2010 11

Re: passing text formatting with sqlite3

2010-01-29 Thread Namibnat
Thanks, I was starting to try stupid things because I just wasn't getting it right. I could simply pass in the article with: {{ data|safe }} Thanks for the help. Vernon On Jan 29, 11:59 am, Daniel Roseman wrote: > On Jan 29, 8:40 am, Namibnat wrote: > > > If I have a "km2" within a Sqlite3 d

Re: Database performance during test execution

2010-01-29 Thread Russell Keith-Magee
On Fri, Jan 29, 2010 at 6:51 PM, Sebastian Pawlus wrote: > Hi everyone > I've very confusing issue related whit databases performance. I've took two > database engines and compared their performance during typical run for > project test suite. > results: > MySQL: Ran 241 tests in 533.822s > Postgr

Database performance during test execution

2010-01-29 Thread Sebastian Pawlus
Hi everyone I've very confusing issue related whit databases performance. I've took two database engines and compared their performance during typical run for project test suite. results: MySQL: Ran 241 tests in *533.822s* PostgreSQL: Ran 241 tests in *34.468s* * * Results are more than strange.

Re: redirect question

2010-01-29 Thread Atamert Ölçgen
Hi Bastir, On Friday 29 January 2010 11:32:02 bastir wrote: > edirect but it cannot find my view function. > Here is the relevant code that I tried. The error I get is: > Reverse for 'show_id' with arguments '()' and keyword arguments > '{'s_id': 1}' not found. > Plz help me.. > You need to give

Re: passing text formatting with sqlite3

2010-01-29 Thread Daniel Roseman
On Jan 29, 8:40 am, Namibnat wrote: > If I have a "km2" within a Sqlite3 database, how do I > format the superscript to show right once it is displayed in the > template.  I have tried python  "\xb2" mark-up, the normal HTML "sup" > tags and I have tried to figure out a way to pass it with the nor

Re: manytomany relations

2010-01-29 Thread Wayne Koorts
What do you mean by "top ten"? On 29/01/2010, at 20:53, CCC wrote: hi, I have two models:user,group,and they are manytomany, class User(model.Model): name = models.CharField(max_length=20) class Group(models.Model): name = models.CharField(max_length=20) users = models.ManytoMany

i18n - duplicates/conflicts in applications

2010-01-29 Thread viz
We have a rather large project consisting of many apps. Each is being developed rather independently. Therefore each app has its own locale/. Naturally, sometimes more apps happen to define the same msgid. When the server is started, the locales from all the installed_apps are loaded in some orde

passing text formatting with sqlite3

2010-01-29 Thread Namibnat
If I have a "km2" within a Sqlite3 database, how do I format the superscript to show right once it is displayed in the template. I have tried python "\xb2" mark-up, the normal HTML "sup" tags and I have tried to figure out a way to pass it with the normal Django variable mechanism. I am still ne

redirect question

2010-01-29 Thread bastir
Hi, i tried to construct a redirect but it cannot find my view function. Here is the relevant code that I tried. The error I get is: Reverse for 'show_id' with arguments '()' and keyword arguments '{'s_id': 1}' not found. Plz help me.. Thx Sebastian in views.py def nametoid(request,name) -

Re: ForeignKey query

2010-01-29 Thread Odd
On 29 Jan, 09:52, Odd wrote: > On 29 Jan, 09:08, Odd wrote: > > > >You originally say the model1 > > > has a foreign key to model2 - I interpret that to mean that the > > > ForeignKey is defined on model1. However, your code references > > > model1.model2_set - which would imply that the FK is de

Re: ForeignKey query

2010-01-29 Thread Odd
On 29 Jan, 09:08, Odd wrote: > >You originally say the model1 > > has a foreign key to model2 - I interpret that to mean that the > > ForeignKey is defined on model1. However, your code references > > model1.model2_set - which would imply that the FK is defined on > > model2, pointing to model1. S

Re: ForeignKey query

2010-01-29 Thread Odd
>You originally say the model1 > has a foreign key to model2 - I interpret that to mean that the > ForeignKey is defined on model1. However, your code references > model1.model2_set - which would imply that the FK is defined on > model2, pointing to model1. So, do you want the objects that are > po