RE: How to have two unicode methods in the models?

2013-06-26 Thread Babatunde Akinyanmi
.or just use an if statement Sent from my Windows Phone From: Christophe Pettus Sent: 6/26/2013 3:37 AM To: django-users@googlegroups.com Subject: Re: How to have two unicode methods in the models? On Jun 25, 2013, at 6:54 PM, yeswanth nadella wrote: > How do I add another unicode method so

Re: hi [django-users] How to do something after "return HttpResponse(html)"?

2013-06-26 Thread Michael Anckaert
On 25/06/13 12:35, lx wrote: > hi all: > I want to do someing after "return HttpResponse(html)". > for example > "" > from django.http import HttpResponse > import datetime > def current_datetime(request): > now = datetime.datetime.now() > html = "It is now %s.

Probem with upgrade to python 2.7

2013-06-26 Thread Andreas Kuhne
Hi, I am trying to upgrade our debian squeeze server running a django 1.5.1 website from python 2.6 to python 2.7.5. I have been able to upgrade python without any problems. However, now when I try to start our site I get an issue with the PIL library. In our code we use "import Image" and not "f

Re: Probem with upgrade to python 2.7

2013-06-26 Thread Avraham Serour
If you upgraded your python installation in place you should reinstall your libraries, specially PIL which needs compiling some parts. Just pip uninstall pil and pip install again. Note that installing pil might be a headache. On a side note I recommend using pillow which is a drop in replacement f

Re: Probem with upgrade to python 2.7

2013-06-26 Thread Andreas Kuhne
2013/6/26 Avraham Serour > If you upgraded your python installation in place you should reinstall > your libraries, specially PIL which needs compiling some parts. Just pip > uninstall pil and pip install again. Note that installing pil might be a > headache. On a side note I recommend using pill

An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread thomaaaas
An easy way to integrate Jcrop in Django's admin? Hello, I'm new in the Django world, and I have a question regarding image resizing. What I'm trying to do: 1) A user upload an image in the admin 2) He is shown the Jcrop interface to crop the image, and submit the form 3) The original image and

Re: Probem with upgrade to python 2.7

2013-06-26 Thread Avraham Serour
not strange at all, dot versions are not compatible, only minor. meaning libraries targeted for python 2.6.x won't necessarily work on 2.7.5 but if your previous installation was 2.7.3 you could just upgrade to python 2.7.5 with no problems On Wed, Jun 26, 2013 at 1:01 PM, Andreas Kuhne wrote: >

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread Avraham Serour
django is in python, just crop the image just any other python program would. people use PIL a lot, try using that (or pillow). you can also use external tools like imagemagick, either using one of the python bindings or calling the command line tools using subprocess On Wed, Jun 26, 2013 at 1:48

Re: Having an issue with Minimal File Upload utility

2013-06-26 Thread Matt Lind
Just wanted to update everyone on the solve for this. It turns out that I was overzealous in my pre-planning. In my urls.py at the top of my project I had defined extra applications that I had not fleshed out yet. So they didn't have any urls.py or views.py defined. Even though the error wa

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread thomaaaas
Sure, but I want a user friendly interface to crop the image. And Jcrop seems to be the best option. So my question is: how to modify my model and the admin interface to include the Jcrop tool? On Wednesday, June 26, 2013 1:29:26 PM UTC+2, אברהם סרור wrote: > > django is in python, just crop th

Missing peice before best practises

2013-06-26 Thread Sayth Renshaw
Hi I am looking for a resource that gives me that Knowledge I need to grasp and understand Django. For python I have learnt LPTHW and completed codeacademy and read the Magnus lie Hetland book. I have completed the Django polls tutorial, and I bought two scoops of Django. Now I have read the

how to change the root url of a project?

2013-06-26 Thread yang guang
HI, all I'm a beginner of django. Here I start a project named mysite. And I can browse it with http://127.0.0.1:8000. But now I want to change it to http://127.0.0.1:8000/mysite/ and stll keep my url mapping as url(r'^$', 'index') instead of (r'^mysite/$', 'index'). Because there are some other

Re: how to change the root url of a project?

2013-06-26 Thread Jani Tiainen
On Wed, 26 Jun 2013 04:40:26 -0700 (PDT) yang guang wrote: > HI, all > I'm a beginner of django. > Here I start a project named mysite. And I can browse it with > http://127.0.0.1:8000. But now I want to change it to > http://127.0.0.1:8000/mysite/ and stll keep my url mapping as url(r'^$', >

Re: how to change the root url of a project?

2013-06-26 Thread Sandro Dutra
# urls.py [...] from django.views.generic import TemplateView [...] urlpatterns = patterns('', [...] url(r'mysite/', TemplateView.as_view(template_name="index.html")), [...] ) or import the view you want to use. 2013/6/26 Jani Tiainen > On Wed, 26 Jun 2013 04:40:26 -0700 (PDT) > yang guang wr

Django-admin-tools unicode problem

2013-06-26 Thread Jaimerson Leandro Amaro de Araújo
(I posted this on django-admin-tools mail list, but apparently there's no one alive there) Hello, I'm stuck in a encoding issue, on the dashboard template. Some of my models have fields with non-ascii characters (like "à" or "á"), and when I try to load the page, I get the following error: Djan

Django-admin-tools unicode problem

2013-06-26 Thread Jaimerson Leandro Amaro de Araújo
(I have posted this on django-admin-tools specific mailing list, but apparently there's no one alive there) Hello, I'm stuck in a encoding issue, on the dashboard template. Some of my models have fields with non-ascii characters (like "à" or "á"), and when I try to load the page, I get the follo

Re: Probem with upgrade to python 2.7

2013-06-26 Thread Andreas Kuhne
2013/6/26 Avraham Serour > not strange at all, dot versions are not compatible, only minor. meaning > libraries targeted for python 2.6.x won't necessarily work on 2.7.5 but if > your previous installation was 2.7.3 you could just upgrade to python 2.7.5 > with no problems > > > On Wed, Jun 26, 2

Re: hi [django-users]How to define the response?

2013-06-26 Thread Sandro Dutra
Did you test this code? I think this code has errors... If your objective is parse html/xml/json I think you've to check if the application doesn't provide an API, and use the correct python library to parse. If you need to parse by force, I think you can use BeautifulSoup. 2013/6/26 lx > hi :

Re: Django-admin-tools unicode problem

2013-06-26 Thread Sandro Dutra
Think it's an encode problem. I never use this app but try to add this line o top of your views file: # -*- coding: utf-8 -*- 2013/6/26 Jaimerson Leandro Amaro de Araújo > (I posted this on django-admin-tools mail list, but apparently there's no > one alive there) > > > Hello, I'm stuck in a e

Missing peice before best practises

2013-06-26 Thread Sayth Renshaw
Any thoughts? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@google

Re: Missing peice before best practises

2013-06-26 Thread Marcin Szamotulski
On 06:19 Wed 26 Jun , Sayth Renshaw wrote: > Any thoughts? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.

How i can get real value of ForeingKey?

2013-06-26 Thread Mário Idival
Good morning, Guys, how can I get the real value of a ForeignKey? Examples: class A (models.Model): field1 = models.CharField (max_length = 10) class B (models.Model): field_b1 = models.CharField (max_length = 10) a_field = models.ForeingKey (A) right, now imagine that on the ben

How i can get real value of ForeignKey?

2013-06-26 Thread Mário Idival
Good morning, Guys, how can I get the real value of a ForeignKey? Examples: class A (models.Model): field1 = models.CharField (max_length = 10) class B (models.Model): field_b1 = models.CharField (max_length = 10) a_field = models.ForeingKey (A) right, now imagine that on the ben

Re: Missing peice before best practises

2013-06-26 Thread Tom Evans
On Wed, Jun 26, 2013 at 2:19 PM, Sayth Renshaw wrote: > Any thoughts? First of all, there is no requirement to use either of those tools to use django. Its a curious complaint you have. You don't want to use the documentation since it doesn't document something that you already know about! In r

Re: Missing peice before best practises

2013-06-26 Thread Roger Barnes
Is there something that the Django documentation itself is lacking? https://docs.djangoproject.com/en/dev/topics/install/#installing-official-release On Wednesday, 26 June 2013 16:56:49 UTC+10, Sayth Renshaw wrote: > > So I turned to the django book online, but have a lack of faith here as > the

Re: Django-admin-tools unicode problem

2013-06-26 Thread Jaimerson Leandro Amaro de Araújo
Uh, I know it`s an encoding problem, I was hoping there was a way of changing default charset for that app. Em quarta-feira, 26 de junho de 2013 10h16min02s UTC-3, Odin escreveu: > > Think it's an encode problem. I never use this app but try to add this > line o top of your views file: > > # -*-

Re: Django-admin-tools unicode problem

2013-06-26 Thread Sandro Dutra
Jaimerson, ainda assim creio que você deva tentar adicionar ao topo de suas views e/ou dos módulos usados do admin-tools a linha: # -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*- Isso permitirá ao Python ler o arquivo no encoding definido. 2013/6/26 Jaimerson Leandro Amaro de Araújo >

Re: How i can get real value of ForeingKey?

2013-06-26 Thread Goran
It's because class A doesn't have unicode defined, so by default primary key is used to present objects of the class A. Create unicode function and return any field you need. class A (models.Model): field1 = models.CharField (max_length = 10) def __unicode__(self): return sel

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread m1chael
I did this by creating a custom admin view that utilizes JCrop On Wed, Jun 26, 2013 at 7:56 AM, thoms wrote: > Sure, but I want a user friendly interface to crop the image. And Jcrop > seems to be the best option. > So my question is: how to modify my model and the admin interface to > incl

redirection problem

2013-06-26 Thread Roberto López López
Hi, After creating an object from the admin interface I'm redirected to a "localized" version of the url. For example, if the original url is http://127.0.0.1:8000/admin/project/project/2/ , I'm redirected to http://127.0.0.1:8000/en/admin/project/project/2/ . I suppose this has to do with the m

forloop breaking

2013-06-26 Thread Harjot Mann
What are the methods to break forloop? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send ema

Re: redirection problem

2013-06-26 Thread Roberto López López
Update: if I disable 'django.middleware.locale.LocaleMiddleware', it's not redirecting anymore. But I need to have i18n support in my website! Any idea? On 06/26/2013 05:09 PM, Roberto López López wrote: > Hi, > > After creating an object from the admin interface I'm redirected to a > "localiz

Re: forloop breaking

2013-06-26 Thread Goran
You can always use IF for foo in bar: if foo == 1: do something even redirect else: foo On Wednesday, June 26, 2013 5:09:58 PM UTC+2, Harjot Mann wrote: > > What are the methods to break forloop? > -- You received this message because you are subscribe

Re: forloop breaking

2013-06-26 Thread Jonathan Baker
Here is a link to the Python control flow tools section on 'break': http://docs.python.org/2/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops On Wed, Jun 26, 2013 at 9:28 AM, Goran wrote: > You can always use IF > for foo in bar: > if foo == 1: >

Re: forloop breaking

2013-06-26 Thread Harjot Mann
Actually I want to remove the heading of my table in templates if it is not filled. I have done this using this coding: {% for test in st|slice:":1" %}S.No {% ifnotequal test.Description "" %} Description{% endifnotequal %} {% ifnotequal test.Thickness "" %}Thickness{% endifnotequal %}

prefetch_related - possible to avoid "IN" ?

2013-06-26 Thread Alex
Hi - I am using prefetch_related as an efficient way to populate a large list of objects whose attributes that are one-to_many relationship. We have cases where we return a list of around 10,000 objects. This produces an SQL query with an "IN" clause and a list 10,000 IDs. Is it possible to ins

wsgi + XAMPP

2013-06-26 Thread Timur Kartaev
Hi, I know, that this is one of the most spread topic and there are a lot of discussions but in my case I have Django 1.3 and Python 2.6. I've checked tons of them but all links are out of date or not working anymore. Thank you in advance -- You received this message because you are subscribed

wsgi + XAMMP

2013-06-26 Thread Timur Kartaev
Hi everyone, I know, that this is one of the most spread topic and there are a lot of discussions but in my case I have Django 1.3 and Python 2.6. I want to install it on my Windows 7. I've checked tons of links but all of them are out of date or not working anymore. Thank you in advance -- Yo

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread Jason Arnst-Goodrich
As a former PHP programmer who's switched to Django - Trying to modify the administration app can be hard. It's something I still stay away from because I feel once you start adding functionality that doesn't come working out of the box, you're better off building your own admin app. I don't t

Re: wsgi + XAMMP

2013-06-26 Thread Hélio Miranda
what is your doubt yourself? Why not use the most current versions? For example django 1.5.1 python 2.7? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to djan

Re: wsgi + XAMMP

2013-06-26 Thread Charly Román
2013/6/26 Hélio Miranda : > what is your doubt yourself? > Why not use the most current versions? > > For example django 1.5.1 python 2.7? > And why XAMPP? Are you trying to use django on local machine? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread Javier Guerra Giraldez
On Wed, Jun 26, 2013 at 11:38 AM, Jason Arnst-Goodrich wrote: > Trying to modify the administration app can be hard. It's something I still > stay away from because I feel once you start adding functionality that > doesn't come working out of the box, you're better off building your own > admin ap

Re: forloop breaking

2013-06-26 Thread yati sagade
The best thing I can think of is to send from the view a set/list of available attributes such that there is at least one item with a non empty value for those attributes. This can be achieved by a single iteration on the iterable `st'. Then in the template, you can just check if, for example Descr

Re: Hi..how to create seperate label next to sign up button in login page and direct user to new page using django?

2013-06-26 Thread Viji Venkatesan
can you please explain it clearly because am new to djagno...now am woking on (horizon) openstack project.. will you please say clearly in which file will have to make changes inorder to do add seperate label next to signup button in login page i.e., federated login?? our project code is availa

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread Sanjay Bhangar
On Wed, Jun 26, 2013 at 3:48 AM, thoms wrote: > An easy way to integrate Jcrop in Django's admin? > > Hello, > > I'm new in the Django world, and I have a question regarding image > resizing. > > What I'm trying to do: > 1) A user upload an image in the admin > 2) He is shown the Jcrop interf

django deploy structure

2013-06-26 Thread fred
I've got django 1.5 deploying successfully to a Linux Apache system with mod_wsgi. This system is still being developed and changes are frequent. I currently just copy the Eclipse project directory over, which gives me the site/settings as well as the app. This works, but has the disadvantag

Re: Missing peice before best practises

2013-06-26 Thread Sayth Renshaw
> Its a curious complaint you have. You don't want >to use the >documentation since it doesn't document >something that you already There's a misunderstanding here it's a) Not django docs but the opensource django book. B) the book ends up describing over a vast area all the possible different ins

Save String /Value to Table Entry

2013-06-26 Thread hiQ
I currently use Microsoft Visual Studio 2010 Express *(my hardware is working under Windows)* and have created an application that can read strings from an external source and display them on Msgbox's. I would like to save these values into an table in django so I can query them later. Is this

Re: django deploy structure

2013-06-26 Thread Nick Apostolakis
You could use a code versioning system like git or bazaar.when you want to deploy just pull from your repository Στις 26 Ιουν 2013 8:46 μ.μ., ο χρήστης "fred" έγραψε: > I've got django 1.5 deploying successfully to a Linux Apache system with > mod_wsgi. This system is still being developed and

Re: how to change the root url of a project?

2013-06-26 Thread yang guang
Thank you, Jani! What you said is exactly what I want to know. I didn't distinguish the dev environment and product environment. And I have fixed it now. Guang 在 2013年6月26日星期三UTC+8下午8时07分39秒,Jani Tiainen写道: > > On Wed, 26 Jun 2013 04:40:26 -0700 (PDT) > yang guang > wrote: > > > HI, all > >

Re: How i can get real value of ForeingKey?

2013-06-26 Thread Jani Tiainen
On Wed, 26 Jun 2013 10:47:09 -0300 Mário Idival wrote: > Good morning, > Guys, how can I get the real value of a ForeignKey? > Examples: > class A (models.Model): > field1 = models.CharField (max_length = 10) > > class B (models.Model): > field_b1 = models.CharField (max_length = 10)

Re: forloop breaking

2013-06-26 Thread vijay shanker
You are looking for "break" On Wednesday, June 26, 2013 8:39:58 PM UTC+5:30, Harjot Mann wrote: > > What are the methods to break forloop? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Re: wsgi + XAMMP

2013-06-26 Thread Timur Kartaev
I have to continue developing project that was written in django 1.3 and python 2.6 :( среда, 26 июня 2013 г., 23:43:34 UTC+7 пользователь Hélio Miranda написал: > > what is your doubt yourself? > Why not use the most current versions? > > For example django 1.5.1 python 2.7? > >> -- You recei

Re: wsgi + XAMMP

2013-06-26 Thread Timur Kartaev
Yes, I am trying to use django on local machine and want to use MySQL. If you have any other recommendation what I can install instead of XAMPP please write. среда, 26 июня 2013 г., 23:45:43 UTC+7 пользователь Charly Román написал: > > 2013/6/26 Hélio Miranda >: > > what is your doubt yourself?

Re: forloop breaking

2013-06-26 Thread Gladson Simplício Brito
http://docs.python.org/2/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops 2013/6/27 vijay shanker > You are looking for "break" > > On Wednesday, June 26, 2013 8:39:58 PM UTC+5:30, Harjot Mann wrote: >> >> What are the methods to break forloop? >> > -- > You re

Re: wsgi + XAMMP

2013-06-26 Thread Sanjay Bhangar
Hi Timur, If you are using this to test / develop on your local machine, you should not need XAMPP. Django comes with its own testing development server, so you should not need Apache if you are using this to test / develop locally. The way I have done this on Windows is just install the python b

Re: forloop breaking

2013-06-26 Thread yati sagade
I doubt she has a problem with the Python for-loop. She is trying to achieve similar control flow in the Django templating language's for loop. On Thu, Jun 27, 2013 at 10:33 AM, Gladson Simplício Brito < gladsonbr...@gmail.com> wrote: > > http://docs.python.org/2/tutorial/controlflow.html#break-

Re: Django-admin-tools unicode problem

2013-06-26 Thread gilberto dos santos alves
tudo depende do seu editor de texto. por exemplo no windows em português do brasil normalmente é usado o cp1250 como padrão. mas na hora de salvar o seu arquivo você pode escolher salvá-lo como utf-8 (aí no início do código vai a correspondente diretiva) se preferir salvar em outro codepage deve