Re: Upload Image

2013-04-22 Thread Hélio Miranda
I still can not upload image
Someone can give me one more help?
'm New to Django and did not know what I'm doing wrong ...

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Upload Image

2013-04-22 Thread Hélio Miranda
I'm doing the following:
http://plnkr.co/edit/neqmvI13prMySMtHQHta

Is something wrong? What could it be?
As it is, should not be saving the image in folder?

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Need good image on the fly resizing

2013-04-22 Thread Avraham Serour
You should use Pillow instead of PIL


On Mon, Apr 22, 2013 at 8:59 AM, yati sagade  wrote:

> Check PIL out:
> http://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio
>
>
> On Mon, Apr 22, 2013 at 6:05 AM, frocco  wrote:
>
>> Can someone point me to a good package?
>>
>> Thanks
>>
>> --
>> 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@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> --
> Yati Sagade
>
> Software Engineer at mquotient 
> 
>
> Twitter: @yati_itay  | Github: 
> yati-sagade
>
> Organizing member of TEDx EasternMetropolitanBypass
> http://www.ted.com/tedx/events/4933
>
> https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869
>
>   --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to link different kinds of objects?

2013-04-22 Thread Bastian
Thanks for your answer. About the constraints: a feed can be empty or contain 
one or more objects. And an object must belong to at least one feed. I have run 
some tests and the m2m field works perfectly for that.

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Problem uplaod

2013-04-22 Thread Hélio Miranda
I'm trying to make a simple upload as follows:
http://plnkr.co/edit/neqmvI13prMySMtHQHta

But something is wrong, because it saves the image in the folder. What 
could it be? What am I doing wrong?
I'm New to Django

thank you

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: a wired problem with Debug for django1.5.1

2013-04-22 Thread Venkatraman S
On Mon, Apr 22, 2013 at 8:30 AM, liu li  wrote:

>
> When Debug = False, all of things are working fine,
>
> when Debug = True, browser got an error with 500
>
> so do you know why?
>
> I am using nginx to handle all of static files like css,img
>

Is INTERNAL_IPS / ALLOWED_HOSTS set?

-V
@venkasub 

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re-usable app for REST API creation with Python 3 support?

2013-04-22 Thread Thomas Weholt
I'm looking for a re-usable app for django that can help create a REST-ful
API, but when trying to install django-piston and django-tastypie in my
Python 3.3 virtual environment they both fail.

Are there other alternatives? Are they suppose to work under Python 3.3 or
am I doing something wrong?

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Python Developer Position

2013-04-22 Thread G.T. RAO
Python Developer Position

If you love programming in Python and have good working experience in 
Twisted, ExtJs and interested in working with a Product development company 
whose R&D center is based in Hyderabad which is providing solutions to 
global MNC's and into Platform development then do give me a call on 
9898396969


Job Title : Python Twisted and ExtJS Developers.
No. of Opening(s) : 3
Educational Qual. : BE/MCA,
Skills : Python 
Good to have skills: Twisted ,ExtJs, Django
Years of experience : 1+

What's in it for you:

- You will manage the build of the product along with building a team.
- If you love coding this is the place to be. 
- Flex, Flex, Flex... we are a super flexible environment, don't worry 
about typical corporate office chores, just get the job done!
- Great pay.

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: a wired problem with Debug for django1.5.1

2013-04-22 Thread David Patiño
Hi,

When Django 1.5.1 is being used with DEBUG=False then ALLOWED_HOSTS
parameter in settings.py must be set up.

Please try to check if that solves the problem.


Cheers,



 




* David Patiño Quintela
 *VoIP Engineer

 * Fixed: *+34 902 999 465
*  Mobile:* +34 653 802 009
  *Email:* david.pat...@quobis.com
  *Site: *http://www.quobis.com
  *Blog:* http://blog.quobis.com
* * 
—
This electronic message contains information which may be privileged or
confidential. The information is intended to be for the use of the
individual(s) or entity named above. *
*


2013/4/22 liu li 

> Hi
>
> When Debug = False, all of things are working fine,
>
> when Debug = True, browser got an error with 500
>
> so do you know why?
>
> I am using nginx to handle all of static files like css,img
>
>  --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to link different kinds of objects?

2013-04-22 Thread Avraham Serour
So it looks like the m2m should be in the object Model. one more thing,
maybe it would be worth it to inline the object admin in the feed admin
take a look at
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin


On Mon, Apr 22, 2013 at 12:22 PM, Bastian wrote:

> Thanks for your answer. About the constraints: a feed can be empty or
> contain one or more objects. And an object must belong to at least one
> feed. I have run some tests and the m2m field works perfectly for that.
>
> --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Re-usable app for REST API creation with Python 3 support?

2013-04-22 Thread Xavier Ordoquy
Hi Thomas,

You should give a go to Django Rest Framework 
(http://django-rest-framework.org/) as it has been ported to Python3.


Regards,
Xavier Ordoquy,
Linovia.

Le 22 avr. 2013 à 12:08, Thomas Weholt  a écrit :

> I'm looking for a re-usable app for django that can help create a REST-ful 
> API, but when trying to install django-piston and django-tastypie in my 
> Python 3.3 virtual environment they both fail. 
> 
> Are there other alternatives? Are they suppose to work under Python 3.3 or am 
> I doing something wrong?
> 
> -- 
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
> 
> -- 
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to link different kinds of objects?

2013-04-22 Thread Michael Hernandez
Sorry I am late to this thread I started typing up a response yesterday but 
never got around to sending it. Let me first reviews Problem scope.
1. You have a Feed, which is an object.
2. A feed can be created by any user.
3. A user can create an object. Is this object premade and they are just 
saving it with values, or are you actually talking about custom enduser 
objects.

My mind in these problems always seems to jump to json serialization at the 
db layer. 

Two Models: Feed and FeedObject

Feed is related m2m to FeedObject

FeedObject has a field of type Text that contains a JSON serialized string 
of the created object. in the proper format for a feed to take it in.
FeedObject also has any fields necessary to identify what might be in the 
JSON text, so that you can do quick searches and sorts.

This is the methodology i used when i was building out Recent Activity 
Streams

You should come up with a good schema for a feedobject  like 
http://activitystrea.ms/


On Monday, April 22, 2013 6:48:33 AM UTC-4, אברהם סרור wrote:
>
> So it looks like the m2m should be in the object Model. one more thing, 
> maybe it would be worth it to inline the object admin in the feed admin
> take a look at 
> https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin
>
>
> On Mon, Apr 22, 2013 at 12:22 PM, Bastian 
> > wrote:
>
>> Thanks for your answer. About the constraints: a feed can be empty or 
>> contain one or more objects. And an object must belong to at least one 
>> feed. I have run some tests and the m2m field works perfectly for that.
>>
>> --
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Need good image on the fly resizing

2013-04-22 Thread Aljoša Mohorović
check http://django-imagekit.readthedocs.org

Aljosa

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem uplaod

2013-04-22 Thread Michael Hernandez
Hi, Miranda I tried to help you in your other thread. Are you getting 
errors. Can you paste them. 
What is the problem right now?

On Monday, April 22, 2013 5:43:26 AM UTC-4, Hélio Miranda wrote:
>
> I'm trying to make a simple upload as follows:
> http://plnkr.co/edit/neqmvI13prMySMtHQHta
>
> But something is wrong, because it saves the image in the folder. What 
> could it be? What am I doing wrong?
> I'm New to Django
>
> thank you
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Python Developer Position

2013-04-22 Thread vinoth job
can you please provide company's name


On Mon, Apr 22, 2013 at 12:13 PM, G.T. RAO  wrote:

> Python Developer Position
>
> If you love programming in Python and have good working experience in
> Twisted, ExtJs and interested in working with a Product development company
> whose R&D center is based in Hyderabad which is providing solutions to
> global MNC's and into Platform development then do give me a call on
> 9898396969
>
>
> Job Title : Python Twisted and ExtJS Developers.
> No. of Opening(s) : 3
> Educational Qual. : BE/MCA,
> Skills : Python
> Good to have skills: Twisted ,ExtJs, Django
> Years of experience : 1+
>
> What's in it for you:
>
> - You will manage the build of the product along with building a team.
> - If you love coding this is the place to be.
> - Flex, Flex, Flex... we are a super flexible environment, don't worry
> about typical corporate office chores, just get the job done!
> - Great pay.
>
> --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem uplaod

2013-04-22 Thread Hélio Miranda
I managed to solve the problem ...
The problem was that I needed to put in "index.html" this: {{form}}

thank you

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




I have searched and searched for a CSV Importer that does the following.

2013-04-22 Thread sparky
I have searched and searched for a CSV Importer that does the following...
*
Imports a CSV
Allows users to then select the header that corresponds to the model.*

But, honest nothing exists I can find, anyone know of any app out there in 
Django that does this I could have missed?

As close as I have gotten is with 
http://django-csv-importer.readthedocs.org/en/latest/ but this has one big 
draw back, the user has to know what the fields they need  to start with 
and cannot config after upload.

Thanks   

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to switch languages?

2013-04-22 Thread Cody Scott
I am trying to get translations to work on my site.

I have marked words for translation and they show up in the django.po file.

I am wondering what is the proper way to switch the current language.

Currently I have the following in my project urls.py

urlpatterns = i18n_patterns('',
# etc
)

urlpatterns += patterns('', 
(r'^i18n/', include('django.conf.urls.i18n')),
)

And to switch languages I change the /en/ in my url to /ja/ or /fr/.

I have two issues. 

1) The page is not being translated except for 'Yes' and 'No' which are 
translated even if I remove them from my .po file. So there must be a 
default set of translation words? Or Chrome is seeing the /fr/ in the URL 
and translating it for me? I can't explain why that is happening. Even if I 
change what 'Yes' and 'No' translate to it doesn't change what is displayed.

2) The next page I visit reverts to a English with the /en/. Yes english is 
my default language in settings.py.

#settings.py
#Used for translations
gettext = lambda s: s
LANGUAGES = (
('en', gettext('English')),
('fr', gettext('French')),
('ja', gettext('Japanese')),
)


-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django Python Understanding Classes with an example

2013-04-22 Thread sparky
I'm just learning Python and Django.

**Could someone tell me where I'm going wrong with below?** 

What I want to do is something like this

csvobject = CSVViewer(file)
rows = csvobject.get_row_count()


This is what I have so far. Remember this is all new to me so I'm looking 
for a an explanation. Thanks. 

class CSVViewer:


def __init__(self, file=None):
self.file = file

def read_file(self):
data = []
file_read = csv.reader(self.file)
for row in file_read:
data.append(row)
return data


def get_row_count(self):

 
return len(read_file(self))


Any experts or pointer or reading is welcome. Thanks again

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to switch languages?

2013-04-22 Thread Addy Yeow
There are several ways to switch language (
https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference).
I normally set django_language session variable to the preferred language.
For 1), have you compiled your messages into .mo files? You will also need
to reload your server to load the new .mo files.


On Tue, Apr 23, 2013 at 1:24 AM, Cody Scott wrote:

> I am trying to get translations to work on my site.
>
> I have marked words for translation and they show up in the django.po file.
>
> I am wondering what is the proper way to switch the current language.
>
> Currently I have the following in my project urls.py
>
> urlpatterns = i18n_patterns('',
> # etc
> )
>
> urlpatterns += patterns('',
> (r'^i18n/', include('django.conf.urls.i18n')),
> )
>
> And to switch languages I change the /en/ in my url to /ja/ or /fr/.
>
> I have two issues.
>
> 1) The page is not being translated except for 'Yes' and 'No' which are
> translated even if I remove them from my .po file. So there must be a
> default set of translation words? Or Chrome is seeing the /fr/ in the URL
> and translating it for me? I can't explain why that is happening. Even if I
> change what 'Yes' and 'No' translate to it doesn't change what is displayed.
>
> 2) The next page I visit reverts to a English with the /en/. Yes english
> is my default language in settings.py.
>
> #settings.py
> #Used for translations
> gettext = lambda s: s
> LANGUAGES = (
> ('en', gettext('English')),
> ('fr', gettext('French')),
> ('ja', gettext('Japanese')),
> )
>
>
>  --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django 1.5.1 on Google App Engine python27

2013-04-22 Thread Timothy Makobu
Hi all,

According to the appengine docs, It can run any WSGI app. So im thinking,
appart from the ORM, django, any version, can run on appengine.

webapp2 and jinja2 are offered but, why use those when I can use the best?

How do I set this up? I have read this tutorial
https://developers.google.com/appengine/articles/django but it's rather
dated. Is it the same procudure with the titled configuration, or is there
a better way?

Thanks.

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Need good image on the fly resizing

2013-04-22 Thread Richard Jelte
If you don't want to have to handle manually resizing images, I would 
recommend letting something like 
sorl-thumbnail 
handle the re-sizing for you.  You will still need to have PIL or Pillow 
installed first, and make sure that png/jpeg support is available (This 
sometimes takes some 
tinkering
.).

On Sunday, April 21, 2013 6:35:02 PM UTC-6, frocco wrote:
>
> Can someone point me to a good package?
>
> Thanks
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to link different kinds of objects?

2013-04-22 Thread Bastian
Thanks to both of you for your in depth answers and insight. The objects that 
go to the feed are premade. I will try to see to what extent I can use the 
links you provided. 

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Python Understanding Classes with an example

2013-04-22 Thread Gabriel
Hey, it would be better if you told us what's happening when you run this
code, what errors are you getting and all...

But one thing I noticed on the last line:
You don't need to send self to your read_file function, but you do need to
specify that you're calling the function from your object, so:
return len(self.read_file())


Ask away if you got more questions

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to switch languages?

2013-04-22 Thread Cody Scott
How do you get the preferred language?

In the 1.5 docs it says to add 'django.core.context_processors.i18n' to 
your TEMPLATE_CONTEXT_PROCESSORS which variable is that in your settings.py?

If I add it to TEMPLATE_LOADERS and refresh the page I get the error:

'function' object has no attribute 'is_usable'

/usr/local/lib/python2.7/dist-packages/django/template/loader.py in 
find_template_loader, line 112



On Monday, 22 April 2013 11:36:34 UTC-4, ayeowch wrote:
>
> There are several ways to switch language (
> https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference).
>  
> I normally set django_language session variable to the preferred language.
> For 1), have you compiled your messages into .mo files? You will also need 
> to reload your server to load the new .mo files.
>
>
> On Tue, Apr 23, 2013 at 1:24 AM, Cody Scott 
> > wrote:
>
>> I am trying to get translations to work on my site.
>>
>> I have marked words for translation and they show up in the django.po 
>> file.
>>
>> I am wondering what is the proper way to switch the current language.
>>
>> Currently I have the following in my project urls.py
>>
>> urlpatterns = i18n_patterns('',
>> # etc
>> )
>>
>> urlpatterns += patterns('', 
>> (r'^i18n/', include('django.conf.urls.i18n')),
>> )
>>
>> And to switch languages I change the /en/ in my url to /ja/ or /fr/.
>>
>> I have two issues. 
>>
>> 1) The page is not being translated except for 'Yes' and 'No' which are 
>> translated even if I remove them from my .po file. So there must be a 
>> default set of translation words? Or Chrome is seeing the /fr/ in the URL 
>> and translating it for me? I can't explain why that is happening. Even if I 
>> change what 'Yes' and 'No' translate to it doesn't change what is displayed.
>>
>> 2) The next page I visit reverts to a English with the /en/. Yes english 
>> is my default language in settings.py.
>>
>> #settings.py
>> #Used for translations
>> gettext = lambda s: s
>> LANGUAGES = (
>> ('en', gettext('English')),
>> ('fr', gettext('French')),
>> ('ja', gettext('Japanese')),
>> )
>>
>>
>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to switch languages?

2013-04-22 Thread Avraham Serour
I suggest taking a look at
django-localeurl,
I used it instead of a form to change language on my last project. I
believe it is worth taking a look


On Mon, Apr 22, 2013 at 6:58 PM, Cody Scott wrote:

> How do you get the preferred language?
>
> In the 1.5 docs it says to add 'django.core.context_processors.i18n' to
> your TEMPLATE_CONTEXT_PROCESSORS which variable is that in your settings.py?
>
> If I add it to TEMPLATE_LOADERS and refresh the page I get the error:
>
> 'function' object has no attribute 'is_usable'
>
> /usr/local/lib/python2.7/dist-packages/django/template/loader.py in
> find_template_loader, line 112
>
>
>
> On Monday, 22 April 2013 11:36:34 UTC-4, ayeowch wrote:
>
>> There are several ways to switch language (https://docs.djangoproject.**
>> com/en/1.4/topics/i18n/**translation/#how-django-**
>> discovers-language-preference
>> )**. I normally set django_language session variable to the preferred
>> language.
>> For 1), have you compiled your messages into .mo files? You will also
>> need to reload your server to load the new .mo files.
>>
>>
>> On Tue, Apr 23, 2013 at 1:24 AM, Cody Scott  wrote:
>>
>>> I am trying to get translations to work on my site.
>>>
>>> I have marked words for translation and they show up in the django.po
>>> file.
>>>
>>> I am wondering what is the proper way to switch the current language.
>>>
>>> Currently I have the following in my project urls.py
>>>
>>> urlpatterns = i18n_patterns('',
>>> # etc
>>> )
>>>
>>> urlpatterns += patterns('',
>>> (r'^i18n/', include('django.conf.urls.**i18n')),
>>> )
>>>
>>>  And to switch languages I change the /en/ in my url to /ja/ or /fr/.
>>>
>>> I have two issues.
>>>
>>> 1) The page is not being translated except for 'Yes' and 'No' which are
>>> translated even if I remove them from my .po file. So there must be a
>>> default set of translation words? Or Chrome is seeing the /fr/ in the URL
>>> and translating it for me? I can't explain why that is happening. Even if I
>>> change what 'Yes' and 'No' translate to it doesn't change what is displayed.
>>>
>>> 2) The next page I visit reverts to a English with the /en/. Yes english
>>> is my default language in settings.py.
>>>
>>> #settings.py
>>> #Used for translations
>>> gettext = lambda s: s
>>> LANGUAGES = (
>>> ('en', gettext('English')),
>>> ('fr', gettext('French')),
>>> ('ja', gettext('Japanese')),
>>> )
>>>
>>>
>>>  --
>>> 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...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users?hl=en
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>  --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: I have searched and searched for a CSV Importer that does the following.

2013-04-22 Thread Avraham Serour
looks like you'll have to write something like this yourself, it doesn't
seem hard to make a page presenting the user with an option before loading
the file and then using just one column


On Mon, Apr 22, 2013 at 5:47 PM, sparky  wrote:

> I have searched and searched for a CSV Importer that does the following...
> *
> Imports a CSV
> Allows users to then select the header that corresponds to the model.*
>
> But, honest nothing exists I can find, anyone know of any app out there in
> Django that does this I could have missed?
>
> As close as I have gotten is with
> http://django-csv-importer.readthedocs.org/en/latest/ but this has one
> big draw back, the user has to know what the fields they need  to start
> with and cannot config after upload.
>
> Thanks
>
> --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Modifying a field in another model

2013-04-22 Thread Vittorio
My (newbye) problem is as follows:

Suppose

class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
address = models.CharField(max_length=100)


class Lent_Book(models.Model):
title = models.CharField(max_length=100)
to_whom = models.ForeignKey(Person)
last_known_address= HERE I WOULD LIKE TO SHOW AND, IF NECESSARY, MODIFY 
Person.address

In a nutshell, my problem is: when I run admin and open Lent_book I would like 
to have a changeable field 'last-know_address' that  modifies Person.address in 
one shot (without having to open Person).

Is that possible and how?

An example would be highly appreciated.

Ciao from Rome
Vittorio
 
-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: debugging with pycharm

2013-04-22 Thread Nikolas Stevenson-Molnar
I assume you're running it in the debugger? Make sure you regular server
isn't still running. Also, make sure your break point is on a line a
line which does something (e.g., /not/ on a class/function definition,
empty line, etc.)

_Nik

On 4/21/2013 10:14 PM, Mark Lybrand wrote:
> I can't get PyCharm to break at breakpoints when debugging a django
> app. what is the magic incantation i neec to invoke to make this
> happen regardless of where i am in code (views, urls, models,
> templates, etc)
>
> -- 
> Mark :)
> -- 
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: debugging with pycharm

2013-04-22 Thread Mark Lybrand
It would appear that this was broken in 2.7.1.  When I upgraded to 2.7.2
my breakpoints once again work as expected.



On Mon, Apr 22, 2013 at 10:58 AM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:

>  I assume you're running it in the debugger? Make sure you regular server
> isn't still running. Also, make sure your break point is on a line a line
> which does something (e.g., *not* on a class/function definition, empty
> line, etc.)
>
> _Nik
>
>
> On 4/21/2013 10:14 PM, Mark Lybrand wrote:
>
> I can't get PyCharm to break at breakpoints when debugging a django app.
> what is the magic incantation i neec to invoke to make this happen
> regardless of where i am in code (views, urls, models, templates, etc)
>
> --
> Mark :)
>  --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> 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@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Mark :)

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to switch languages?

2013-04-22 Thread Cody Scott
I installed django-localeurl and disabled 

'django.middleware.locale.LocaleMiddleware',


and

i18n_patterns


but it had the same issue of only translating 'Yes' and 'No' and it 
reverted back to /en/ on every new page load.



On Monday, 22 April 2013 12:08:34 UTC-4, אברהם סרור wrote:
>
> I suggest taking a look at 
> django-localeurl, 
> I used it instead of a form to change language on my last project. I 
> believe it is worth taking a look
>
>
> On Mon, Apr 22, 2013 at 6:58 PM, Cody Scott 
> > wrote:
>
>> How do you get the preferred language?
>>
>> In the 1.5 docs it says to add 'django.core.context_processors.i18n' to 
>> your TEMPLATE_CONTEXT_PROCESSORS which variable is that in your settings.py?
>>
>> If I add it to TEMPLATE_LOADERS and refresh the page I get the error:
>>
>> 'function' object has no attribute 'is_usable'
>>
>> /usr/local/lib/python2.7/dist-packages/django/template/loader.py in 
>> find_template_loader, line 112
>>
>>
>>
>> On Monday, 22 April 2013 11:36:34 UTC-4, ayeowch wrote:
>>
>>> There are several ways to switch language (https://docs.djangoproject.**
>>> com/en/1.4/topics/i18n/**translation/#how-django-**
>>> discovers-language-preference
>>> )**. I normally set django_language session variable to the preferred 
>>> language.
>>> For 1), have you compiled your messages into .mo files? You will also 
>>> need to reload your server to load the new .mo files.
>>>
>>>
>>> On Tue, Apr 23, 2013 at 1:24 AM, Cody Scott wrote:
>>>
 I am trying to get translations to work on my site.

 I have marked words for translation and they show up in the django.po 
 file.

 I am wondering what is the proper way to switch the current language.

 Currently I have the following in my project urls.py

 urlpatterns = i18n_patterns('',
 # etc
 )

 urlpatterns += patterns('', 
 (r'^i18n/', include('django.conf.urls.**i18n')),
 )

  And to switch languages I change the /en/ in my url to /ja/ or /fr/.

 I have two issues. 

 1) The page is not being translated except for 'Yes' and 'No' which are 
 translated even if I remove them from my .po file. So there must be a 
 default set of translation words? Or Chrome is seeing the /fr/ in the URL 
 and translating it for me? I can't explain why that is happening. Even if 
 I 
 change what 'Yes' and 'No' translate to it doesn't change what is 
 displayed.

 2) The next page I visit reverts to a English with the /en/. Yes 
 english is my default language in settings.py.

 #settings.py
 #Used for translations
 gettext = lambda s: s
 LANGUAGES = (
 ('en', gettext('English')),
 ('fr', gettext('French')),
 ('ja', gettext('Japanese')),
 )
  

  -- 
 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...@**googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.

 Visit this group at 
 http://groups.google.com/**group/django-users?hl=en
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_out
 .
  
  

>>>
>>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Need good image on the fly resizing

2013-04-22 Thread frocco
I tried sorl-thumbnail and user is complaining that some images are not 
resized to same size as others.

On Monday, April 22, 2013 11:39:19 AM UTC-4, Richard Jelte wrote:
>
> If you don't want to have to handle manually resizing images, I would 
> recommend letting something like 
> sorl-thumbnail 
> handle the re-sizing for you.  You will still need to have PIL or Pillow 
> installed first, and make sure that png/jpeg support is available (This 
> sometimes takes some 
> tinkering
> .).
>
> On Sunday, April 21, 2013 6:35:02 PM UTC-6, frocco wrote:
>>
>> Can someone point me to a good package?
>>
>> Thanks
>>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Need good image on the fly resizing

2013-04-22 Thread frocco
I also just realized that I am not using memcached

I will try this tonight and see if it helps.

On Monday, April 22, 2013 2:33:22 PM UTC-4, frocco wrote:
>
> I tried sorl-thumbnail and user is complaining that some images are not 
> resized to same size as others.
>
> On Monday, April 22, 2013 11:39:19 AM UTC-4, Richard Jelte wrote:
>>
>> If you don't want to have to handle manually resizing images, I would 
>> recommend letting something like 
>> sorl-thumbnail 
>> handle the re-sizing for you.  You will still need to have PIL or Pillow 
>> installed first, and make sure that png/jpeg support is available (This 
>> sometimes takes some 
>> tinkering
>> .).
>>
>> On Sunday, April 21, 2013 6:35:02 PM UTC-6, frocco wrote:
>>>
>>> Can someone point me to a good package?
>>>
>>> Thanks
>>>
>>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Using Django and R in a production environment?

2013-04-22 Thread Derek
Based on googling around this topic, it seems that using RPy2 is the most
common way to interface with R from Python.  However all the discussions on
this seem to centre around working in a desktop (single user) environment.

The one discussion I could find that deals with the issue of working with R
"at scale" is this one -
https://github.com/Sleepingwell/DjangoRpyDemo/blob/master/README.md#django-configuration
- which indicates problems with this approach; and suggests it might be
able to be overcome via creating distinct processes dedicated to run a WSGI
application (although this article does not give any steps on how to do
this, or whether it would work in practice).

Another approach seems to be to use RPy2, with Twisted to enable multiple
sessions:
https://docs.google.com/presentation/d/11LJxej6jnbYKzJftpDudYFfVKjaB0BhOzrBSKaxJ2ME/edit#slide=id.p
.

Yet another approach might be to use Rserve (http://www.rforge.net/Rserve/)
and PyRserve (http://pythonhosted.org/pyRserve/manual.html), but the latter
seems to currently be in beta.

Question is: does anyone have any practical experience actually using
Django with R in a production environment (i.e dozens or hundreds of users
doing high volume number crunching)?

Thanks
Derek

PS Yes, we do need R and not one of the Python-based alternatives, as R
offers many routines simply not available in those as yet (also, the client
needs to re-use, and create new, R scripts themselves)

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to create a Dynamic Hierarchical Form

2013-04-22 Thread Cody Scott
I am trying to create a form where you select product(s) and technology(s) 
and based on your selection different modules are available for selection.

forms.py

def make_quiz_form_class():
#Listing available options
products = [(i, _(i)) for i in Product.objects.all()]
technologies= [(i, _(i)) for i in Technology.objects.all()]
modules = [(i, _(i)) for i in 
Module.objects.filter(product=selected_products, 
technologies=selected_technologies)]

class _QuizForm(forms.Form):
selected_products = forms.ChoiceField(choices = products, 
widget=forms.RadioSelect())
selected_technologies = forms.ChoiceField(choices = technologies, 
widget=forms.RadioSelect())
selected_modules = forms.ChoiceField(choices = modules, 
widget=forms.RadioSelect())

return _QuizForm

views.py

form_class = make_quiz_form_class()
form = form_class(request.POST)

The problem is selected_products and selected_technologies are not defined 
for modules

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Admin pagination not digg-style

2013-04-22 Thread Stanislav Mihaylov
I can't seem to find an easy and simple way to make the Django admin 
paginator display all page numbers rather then displaying them in 'Digg' 
style in the footer navigation.

I read plenty of articles on how to make it Digg style, but it seems in the 
new Django versions it is Digg style by default, so how can I make it 
display all numbers?

Thank you in advance!

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to avoid URLField adding the trailing slash?

2013-04-22 Thread Odagi
Django URLField 
https://docs.djangoproject.com/en/1.5/ref/forms/fields/#urlfield likes to 
add a trailing slash at the end of the user input, forcing all URLs to be 
stored with the extra character, this is wrong. How can I stop 
this behavior and save URLs as submitted by users? 

Thanks.

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: debugging with pycharm

2013-04-22 Thread Ezequiel
On Monday, April 22, 2013 3:03:11 PM UTC-3, Mark Lybrand wrote:

>
> It would appear that this was broken in 2.7.1.  When I upgraded to 2.7.2  
> my breakpoints once again work as expected.
>

I think in 2.7.1 the BP did not work if you set them after running server, 
on 2.7.2 is fixed. But in 2.7.2 I've lost the debug on templates, Do you 
also happened to you?

---
Ezequiel
http://flickrock.com/mikelpierre

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: How to create a Dynamic Hierarchical Form

2013-04-22 Thread Babatunde Akinyanmi
Hi Cody,
I think you should try another approach, something simple as what you have
coded is at best wrong.

make_quiz_form_class  and _QuizForm try to get variables that are not
available. make_quiz_form_class doesn't take any arguments as per your
definition but you are supplying it with request.POST which is
dictionaryish.

Sent from my Windows Phone
--
From: Cody Scott
Sent: 4/22/2013 9:22 PM
To: django-users@googlegroups.com
Subject: How to create a Dynamic Hierarchical Form

I am trying to create a form where you select product(s) and technology(s)
and based on your selection different modules are available for selection.

forms.py

def make_quiz_form_class():
#Listing available options
products = [(i, _(i)) for i in Product.objects.all()]
technologies= [(i, _(i)) for i in Technology.objects.all()]
modules = [(i, _(i)) for i in
Module.objects.filter(product=selected_products,
technologies=selected_technologies)]

class _QuizForm(forms.Form):
selected_products = forms.ChoiceField(choices = products,
widget=forms.RadioSelect())
selected_technologies = forms.ChoiceField(choices =
technologies, widget=forms.RadioSelect())
selected_modules = forms.ChoiceField(choices = modules,
widget=forms.RadioSelect())

return _QuizForm

views.py

form_class = make_quiz_form_class()
form = form_class(request.POST)

The problem is selected_products and selected_technologies are not defined
for modules

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to create a temporary table in Django use ORM

2013-04-22 Thread teddy wang
CREATE TEMPORARY TABLE TEMP (SELECT * FROM TABLE ORDER BY COLUMN_A);
SELECT * FROM TEMP ORDER BY COLUMN_B;
I want to implement this selection in Django use ORM,,,still have no idea,,,
anybody help?
thanks

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: How to create a Dynamic Hierarchical Form

2013-04-22 Thread Babatunde Akinyanmi
Hi Cody,
I think you should try another approach, something simple as what you have
coded is at best wrong.

make_quiz_form_class  and _QuizForm try to get variables that are not
available. make_quiz_form_class doesn't take any arguments as per your
definition but you are supplying it with request.POST which is
dictionaryish.

Sent from my Windows Phone
--
From: Cody Scott
Sent: 4/22/2013 9:22 PM
To: django-users@googlegroups.com
Subject: How to create a Dynamic Hierarchical Form

I am trying to create a form where you select product(s) and technology(s)
and based on your selection different modules are available for selection.

forms.py

def make_quiz_form_class():
#Listing available options
products = [(i, _(i)) for i in Product.objects.all()]
technologies= [(i, _(i)) for i in Technology.objects.all()]
modules = [(i, _(i)) for i in
Module.objects.filter(product=selected_products,
technologies=selected_technologies)]

class _QuizForm(forms.Form):
selected_products = forms.ChoiceField(choices = products,
widget=forms.RadioSelect())
selected_technologies = forms.ChoiceField(choices =
technologies, widget=forms.RadioSelect())
selected_modules = forms.ChoiceField(choices = modules,
widget=forms.RadioSelect())

return _QuizForm

views.py

form_class = make_quiz_form_class()
form = form_class(request.POST)

The problem is selected_products and selected_technologies are not defined
for modules

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.