Re: Please Help a django Beginner!

2011-04-19 Thread nishant kashyap
u can use the link www.djangobook.com try the second edition book . you may also find the .pdf of this on the net. after reading this u can go for the documentation of the django . On Apr 19, 5:36 pm, "Sells, Fred" wrote: > I received this helpful hint from Shawn M.

satchmo: different price for difference areas

2011-04-19 Thread ug Charlie
I am a django beginner. I just made a shop with satchmo. I want to set two price for one product. It is like one button in my page to select the area and display different price for USD or EURO. Could you give me some advice? Thanks. :) -- You received this message because you are subscribed

Re: Unidirectional relations

2011-04-19 Thread Mike Dewhirst
I think you would need an intermediate table 1:n with the parent containing the child ids. Otherwise the children need a foreign key reference to the parent. On 20/04/2011, at 10:06 AM, Juan Pablo Romero Méndez wrote: > Hello, > > Is it possible to create

Re: Unidirectional relations

2011-04-19 Thread Jacob Kaplan-Moss
2011/4/19 Juan Pablo Romero Méndez : > Is it possible to create unidirectional relations within django's orm? > > What I mean is a situation where a parent has a children_set of > references to children, but the children don't have any reference to > the father. See the

Re: compressing uploaded file

2011-04-19 Thread Julio Ona
Hi Daniel, you should see: http://docs.python.org/library/bz2.html#module-bz2 or http://docs.python.org/library/gzip.html#module-gzip But basically you should import the compress function from the library and use it.

Re: website path

2011-04-19 Thread Jacob Kaplan-Moss
2011/4/19 Ján Vorčák : > I've installed a django on my server (running on apache), but I've > configured it to run using url like > www.mydomain.com/django-application/ > > Now when I access some url from django using absolute url it > automatically redirects me to >

Re: db routing by request

2011-04-19 Thread Jacob Kaplan-Moss
On Tue, Apr 19, 2011 at 5:06 AM, Michael P. Soulier wrote: > I noticed that the request object is not passed to the database router, the > intention seems to mainly be to route by model. I have a case where I want to > route based on session data in the request. While I

Re: Cannot submit tickets - always marked as spam!

2011-04-19 Thread Jacob Kaplan-Moss
Hi Jeff -- It's not you; we get a *lot* of spam, and so our spam filters are overly aggressive. You can get around 'em if you create an account. Just visit http://www.djangoproject.com/accounts/register/, register, and then log into Trac once you have the account set up. Thanks, and sorry about

Re: Debugging a unittest

2011-04-19 Thread Shawn Milochik
www.doughellmann.com/PyMOTW/pdb/ -- 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 from this group, send email to django-users+unsubscr...@googlegroups.com. For

Unidirectional relations

2011-04-19 Thread Juan Pablo Romero Méndez
Hello, Is it possible to create unidirectional relations within django's orm? What I mean is a situation where a parent has a children_set of references to children, but the children don't have any reference to the father. Regards, Juan Pablo -- You received this message because you are

compressing uploaded file

2011-04-19 Thread Daniel Gerzo
Hello all, I am uploading some text files through django (using a form FileField), and I am getting InMemoryUploadedFile objects this way. In my handle_uploaded_subtitles() method, which gets the list of InMemoryUploadedFile objects, I would like to compress these files (so that I will get

Debugging a unittest

2011-04-19 Thread Thomas Weholt
I'm wondering if anybody has a hint on how to debug a unittest, or any other piece of code in django, for that matter, using a debugger like winpdb? I'm trying to to a winpdb manage.py test photo, which runs my unittest for my photo app, but winpdb crashes. Are there alternatives? What is the best

Re: website path

2011-04-19 Thread Jeff Blaine
How to avoid hardcoding URL paths in your templates: http://docs.djangoproject.com/en/1.3/ref/templates/builtins/#url Maybe that helps some? I don't think I can be of more help. I'm too new. -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: website path

2011-04-19 Thread Ján Vorčák
Hi Thank you for your response Yeah I've already read that, But in urls.py I have to explicitly say that my url is like django- application/someaplication My point is that I want to avoid writing django-application inside each url (+ in the template Link On Apr 19, 11:03 pm, Jeff Blaine

Re: Why i can reach my media files from my static url?

2011-04-19 Thread Jeff Blaine
Please show your settings: STATIC_ROOT STATICFILES_DIR STATIC_URL MEDIA_ROOT MEDIA_URL -- 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 from this group, send

Re: website path

2011-04-19 Thread Jeff Blaine
I imagine you need to configure your urls.py I suggest going through the whole tutorial, starting at the following page. This is all explained there. http://docs.djangoproject.com/en/1.3/intro/tutorial01/ -- You received this message because you are subscribed to the Google Groups "Django

website path

2011-04-19 Thread Ján Vorčák
Hi, I've installed a django on my server (running on apache), but I've configured it to run using url like www.mydomain.com/django-application/ Now when I access some url from django using absolute url it automatically redirects me to www.mydomain.com/someapplication instead of

Admin: Model ordering and relationship conditional __unicode__ return values?

2011-04-19 Thread Micky Hulse
Hello, Couple of noob questions: 1. Is it possible to order the models of my app manually (vs. alphabetically) when viewing the app page? See attached "ordering.png". 2. Relationship models: How can I return different __unicode__ values based on the relationship that I am viewing. [code]

Re: Testing if a receiver is connected to a signal

2011-04-19 Thread Bernardo Fontes
Hi, I'm having this problem too. Does anyone knows a good strategy to handle this problem? On 21 fev, 17:50, Vinicius Mendes wrote: > Hi, > > I want to test if a receiver function is connected to a signal in django, > but I don't want other receivers from other apps to be

Re: already logged in users

2011-04-19 Thread Shawn Milochik
Cool. I understand putting a temporary solution in place to get the job done sometimes. Glad I could help. Shawn -- 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

Cannot submit tickets - always marked as spam!

2011-04-19 Thread Jeff Blaine
I've tried twice now to interact with the Django trac. Last week and just now. Both resulted in: badip:state/blacklist.d/127.0.0.1 Please tell me what I am doing wrong. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: already logged in users

2011-04-19 Thread Luterien
Thanks for the warning. But dont worry,i had no intention of leaving it like that. As i said i dont know much about decorators,so i thought it would be better to learn more about decorators before using them. So i was reading the docs. Yes,that is what i was looking for. I modified the login view

Why i can reach my media files from my static url?

2011-04-19 Thread Mirat Bayrak
Hi, i started a project (with django1.3). I made settings for my media files and static files. After that i realized that : i can reach /myproject/media/foo.txt from localhost:8000/static/foo.txt . 1. Why i can reach that from there? 2. That looks like i don't need to add serve media

Re: admin login fails

2011-04-19 Thread pfc
Thank you so much that's all it was! On Apr 19, 2:19 pm, Nick Stinemates wrote: > On Tue, Apr 19, 2011 at 5:36 PM, pfc wrote: > > I did try to delete the db and yes I had to create a new superuser > > after, however this did not fix the

Re: admin login fails

2011-04-19 Thread Nick Stinemates
On Tue, Apr 19, 2011 at 5:36 PM, pfc wrote: > I did try to delete the db and yes I had to create a new superuser > after, however this did not fix the problem. I also reset the db from > the command-line and same result. > Also, it is not a capslock issue, first

Re: already logged in users

2011-04-19 Thread Shawn Milochik
On Tue, Apr 19, 2011 at 2:01 PM, Luterien wrote: > I'm using the template method for now since i dont know much about > decorators. I tried using the decorators at contrib.auth.decorators > but it didnt work. Doing something the wrong way you're comfortable with instead of

Re: already logged in users

2011-04-19 Thread Luterien
I'm using the template method for now since i dont know much about decorators. I tried using the decorators at contrib.auth.decorators but it didnt work. Thanks! On Apr 19, 7:51 pm, Oleg Lomaka wrote: > {% if user.is_authenticated %} >   Hello, what are you doing here? >

Re: admin login fails

2011-04-19 Thread pfc
I did try to delete the db and yes I had to create a new superuser after, however this did not fix the problem. I also reset the db from the command-line and same result. Also, it is not a capslock issue, first thing I checked ;-) The only thing I can think of that is non-standard would be the

Re: For any dictionary in a list, does a value exist for a key?

2011-04-19 Thread bruno desthuilliers
On 18 avr, 18:27, Shawn Milochik wrote: > You can do this pretty easily in Python with any(): > > if any(['foo' in x for x in my_list]): >     #do something should be: if any(x['id'] == 'foo' for x in mylist): do_something() Your above snippet will test if a dict in

Re: already logged in users

2011-04-19 Thread Oleg Lomaka
{% if user.is_authenticated %} Hello, what are you doing here? {% else %} Show login/registration form here {% endif %} Also I think doing it in templates is not right. It's job for decorators. On Tue, Apr 19, 2011 at 7:46 PM, Luterien wrote: > Hello. I'm working on

already logged in users

2011-04-19 Thread Luterien
Hello. I'm working on a django project and now i'm writing register,login and logout pages. I dont want already logged in users to access register or login pages. Is it possible to do that on the template side or do i need to modify my login view ? Any help appreciated! Thanks -- You received

Re: admin login fails

2011-04-19 Thread Ernesto Guevara
Or you can delete database and execute again syncdb. The aplication ask again the password, warning for capslock. =) 2011/4/19 pfc > I'm new to Django and am following the tutorials, specifically: > http://docs.djangoproject.com/en/dev/intro/tutorial02/ > I

Re: Import error No module named urls to url login_in in html page

2011-04-19 Thread Guevara
Thank you Subhranath! I do not know what happened, but I created a new project and put the same configuration and is now working. I think it was a problem with the framework. I made the correction on this line: AUTH_PROFILE_MODULE = 'imobiliaria.login' <-- login app Thanks! On 19 abr,

Re: p.save not working in tutorial

2011-04-19 Thread xpdx
DOH! I'll try that. Thanks! On Apr 17, 2:12 pm, Karen Tracey wrote: > On Sun, Apr 17, 2011 at 5:06 PM, xpdx wrote: > > > >>> p > > > > >>> p.save > > > > > >>> Poll.objects.all() > > [] > > p.save just shows you that p has an attribute named save, and

Re: For any dictionary in a list, does a value exist for a key?

2011-04-19 Thread Chris Roat
Yep - trying to do it in a template. I can just do the logic within in python - it'll mean redundant info going into the template, but that's OK. Thanks for your response, C On Mon, Apr 18, 2011 at 9:27 AM, Shawn Milochik wrote: > You can do this pretty easily in Python

Re: admin login fails

2011-04-19 Thread Joel Goldstick
On Tue, Apr 19, 2011 at 5:31 AM, pfc wrote: > I'm new to Django and am following the tutorials, specifically: > http://docs.djangoproject.com/en/dev/intro/tutorial02/ > I followed the instructions on adding admin to the INSTALLED_APPS, I > also added it to the

Looking for some help/guidance on how to create a facebook application based on django

2011-04-19 Thread mongoose
Hi all, I've created the example django poll application on http://docs.djangoproject.com/en/dev/intro/tutorial01/ Everything works great. I now want to have this poll application be a facebook application. I thought by creating a FB application and just pointing to my hosted Poll application URL

Re: Stackoverflow kind of Answer/commenting app in Django

2011-04-19 Thread Kundan Kumar
The app which i customized is Django voice. http://code.google.com/p/django-voice/ is quite easy to plug. -- 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 from

RE: Please Help a django Beginner!

2011-04-19 Thread Sells, Fred
I received this helpful hint from Shawn M. when faced with the same issue: import os os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' #whereever your settings.py is located. >From the docs: http://docs.djangoproject.com/en/dev/topics/settings/ -Original Message- From:

admin login fails

2011-04-19 Thread pfc
I'm new to Django and am following the tutorials, specifically: http://docs.djangoproject.com/en/dev/intro/tutorial02/ I followed the instructions on adding admin to the INSTALLED_APPS, I also added it to the urls, did syncdb and created the superuser. When trying to login with the

Re: Form containing a Mutipolygon field for Django 1.3

2011-04-19 Thread GARRAM karim
I think a possible solution is to use : http://django-floppyforms.readthedocs.org/en/latest/geodjango.html the solution given in http://stackoverflow.com/questions/559431/how-to-display-data-using-openlayers-with-openstreetmap-in-geodjango didn't work for me there was a problem with this

db routing by request

2011-04-19 Thread Michael P. Soulier
Hi, I noticed that the request object is not passed to the database router, the intention seems to mainly be to route by model. I have a case where I want to route based on session data in the request. While I know that I can explicitely use the using() method, this will be a tad labourious. Will

Re: limit_choices_to (or some other way) to filter ForeignKey choices based on current model field

2011-04-19 Thread Derek
On Apr 16, 7:29 pm, Aljoša Mohorović wrote: > if i have something like this: > === > class MyModel(models.Model): >     name  = models.CharField(max_length=255) > > class OtherModel(models.Model): >     name  = models.CharField(max_length=255) >     mymodel =

Re: Import error No module named urls to url login_in in html page

2011-04-19 Thread Subhranath Chunder
Hi, The problems seems to be with the way you are using the view prefixes in the 'patterns' function in your urls.py Refer to: http://docs.djangoproject.com/en/dev/topics/http/urls/#the-view-prefix You have used 'view' string twice. Thanks, Subhranath Chunder. On Tue, Apr 19, 2011 at 5:11 AM,