Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Russell Keith-Magee
On Tue, May 22, 2012 at 1:05 PM, Ali Shaikh  wrote:
> Hey Django.!!
>
> Please can anyone share Python Web Development with
> Django by Wesley Chun E-Book??

Given that this book can be easily purchased at any number of online
booksellers, I'm assuming that what you're asking for here is for
someone to provide you with a link to a pirated copy of this e-book.

If this is the case, you should know that requests for pirated content
will not be tolerated in this forum, or any other official forum of
the Django project. If you persist in making requests of this nature,
you will be banned from posting.

Yours,
Russ Magee %-)

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



ModelForms and CreateView Help

2012-05-22 Thread wchildsuk
Hi,

I'm trying to use generic class based views to edit a specific
queryset but I can't see to get my code working. I've defined queryset
and relevant form but when the form renders it doesn't contain the
queryset and when it saves it creates a new entry instead of editing
the existing one.

If anyone could help that would be great as I'm completely stuck. A
copy of my code is available here, http://dpaste.com/751045/

Thanks in advance

Wes

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



Re: ModelForms and CreateView Help

2012-05-22 Thread Xavier Ordoquy
Hi,

get is a termination statement for querysets.
please use filter instead.

Regards,
Xavier Ordoquy.

Le 22 mai 2012 à 10:34, wchildsuk a écrit :

> Hi,
> 
> I'm trying to use generic class based views to edit a specific
> queryset but I can't see to get my code working. I've defined queryset
> and relevant form but when the form renders it doesn't contain the
> queryset and when it saves it creates a new entry instead of editing
> the existing one.
> 
> If anyone could help that would be great as I'm completely stuck. A
> copy of my code is available here, http://dpaste.com/751045/
> 
> Thanks in advance
> 
> Wes
> 
> -- 
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

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



Re: ModelForms and CreateView Help

2012-05-22 Thread wchildsuk
Hi Xavier,

I changed my queryset to use filter
(ReminderMessage.objects.filter(id=1)) but it didn't make any
difference to the form rendering correctly with the instance or
saving.

Regards

Wes

On May 22, 9:37 am, Xavier Ordoquy  wrote:
> Hi,
>
> get is a termination statement for querysets.
> please use filter instead.
>
> Regards,
> Xavier Ordoquy.
>
> Le 22 mai 2012 à 10:34, wchildsuk a écrit :
>
>
>
>
>
>
>
> > Hi,
>
> > I'm trying to use generic class based views to edit a specific
> > queryset but I can't see to get my code working. I've defined queryset
> > and relevant form but when the form renders it doesn't contain the
> > queryset and when it saves it creates a new entry instead of editing
> > the existing one.
>
> > If anyone could help that would be great as I'm completely stuck. A
> > copy of my code is available here,http://dpaste.com/751045/
>
> > Thanks in advance
>
> > Wes
>
> > --
> > 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 more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

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



Re: ModelForms and CreateView Help

2012-05-22 Thread bruno desthuilliers
On May 22, 10:34 am, wchildsuk  wrote:
> Hi,
>
> I'm trying to use generic class based views to edit a specific
> queryset but I can't see to get my code working. I've defined queryset

Nope, cf Xavier's answer on this.

> and relevant form but when the form renders it doesn't contain the
> queryset and when it saves it creates a new entry instead of editing
> the existing one.

from the FineManual:

"""class CreateView

A view that displays a form for creating an object, redisplaying
the form with validation errors (if there are any) and saving the
object.
"""

""class UpdateView

A view that displays a form for editing an existing object,
redisplaying the form with validation errors (if there are any) and
saving changes to the object.
"""

Your code:

"""
class ManageReminderMessages(CreateView):
   ...
"""

As a last note: the pk of the model instance to be edited is usually
passed as part of the url (cf the relevant chapter in the
FineManual)... Unless you want to write a new view for each and any
instance of your model, of course ;)

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



Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Ali Shaikh
Dear Russell ,

Actually I wanted to ask free PDF file fro that book.Am sorry,I wont
repeat this

On May 22, 12:12 pm, Russell Keith-Magee 
wrote:
> On Tue, May 22, 2012 at 1:05 PM, Ali Shaikh  wrote:
> > Hey Django.!!
>
> > Please can anyone share Python Web Development with
> > Django by Wesley Chun E-Book??
>
> Given that this book can be easily purchased at any number of online
> booksellers, I'm assuming that what you're asking for here is for
> someone to provide you with a link to a pirated copy of this e-book.
>
> If this is the case, you should know that requests for pirated content
> will not be tolerated in this forum, or any other official forum of
> the Django project. If you persist in making requests of this nature,
> you will be banned from posting.
>
> Yours,
> Russ Magee %-)

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



Re: ModelForms and CreateView Help

2012-05-22 Thread wchildsuk
Excellent, that works perfectly.

Thanks for you help.

Wes

On May 22, 9:58 am, bruno desthuilliers
 wrote:
> On May 22, 10:34 am, wchildsuk  wrote:
>
> > Hi,
>
> > I'm trying to use generic class based views to edit a specific
> > queryset but I can't see to get my code working. I've defined queryset
>
> Nope, cf Xavier's answer on this.
>
> > and relevant form but when the form renders it doesn't contain the
> > queryset and when it saves it creates a new entry instead of editing
> > the existing one.
>
> from the FineManual:
>
> """class CreateView
>
>     A view that displays a form for creating an object, redisplaying
> the form with validation errors (if there are any) and saving the
> object.
> """
>
> ""class UpdateView
>
>     A view that displays a form for editing an existing object,
> redisplaying the form with validation errors (if there are any) and
> saving changes to the object.
> """
>
> Your code:
>
> """
> class ManageReminderMessages(CreateView):
>    ...
> """
>
> As a last note: the pk of the model instance to be edited is usually
> passed as part of the url (cf the relevant chapter in the
> FineManual)... Unless you want to write a new view for each and any
> instance of your model, of course ;)

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



Re: Image Update with Django - Admin site

2012-05-22 Thread kenneth gonsalves
On Fri, 2012-05-18 at 02:42 -0700, nishad wrote:
> 1. When i was uploaded/(browse) and saved an Article with an image
> (.jpg) , for the first time it saves perfectly
> as follows (smedia/images/misc/sample.jpg)
> 2. For the second time i have tried to update some textual contents in
> the article and saves once again through the same admin interface ,
> but this time image get saved as follows (smedia/images/misc/
> sample_1.jpg)
> 
> Issue :-
> It cause an image duplication in respective folder and also an error
> when page/template is rendered through browser.
> 
> Can any one please suggest a method to avoid the duplication of image
> on updating the existing one.
> 
> 

I am unable to replicate this. 
-- 
regards
Kenneth Gonsalves

-- 
regards
Kenneth Gonsalves

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



Following multiple reverse relationships

2012-05-22 Thread sk
If I have a hierarchy of models such that:

class A(models.Model):
name = CharField(max_length=10)

class B(models.Model):
name = CharField(max_length=10)
a= ForeignKey(A)

class C(models.Model):
name = CharField(max_length=10)
b= ForeignKey(B)

If I have an instance of C, as returned by:

c = C.objects.get(pk=1)

How do I get the name of A?

I realise I can go via B, but I am hoping to be able to follow the
chain back to A from any arbitrary point in (a much longer) chain.

For example:
If this was repeated up to F in an identical manner.
If I pass a function any instance from A to F I would want to return
A.name.

I am sure there must be a simple way to get the root data, but I am
having trouble finding it.

Kind Regards
Stephen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Alexey
http://rutracker.org/forum/viewtopic.php?t=3720635

On 22 май, 09:05, Ali Shaikh  wrote:
> Hey Django.!!
>
> Please can anyone share Python Web Development with
> Django by Wesley Chun E-Book??
>
> Thank Yooo

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



Getting Started-Introduction

2012-05-22 Thread vishrut mehta
Hello Django users and Developers,
I am Vishrut Mehta,studing Computer
Sci  and Eng. BTech 2nd year.I was just getting started with contributing
to Open Source Community.So wanted to start from the thing i love like
developing softwares,apps,website,etc.I dont have any previous experience
working in any open source org,this would be the first time,so i want you
to help me move ahead.
I am very enthusiatic with the things that interest me,love to write codes
in python.
I am looking forward for a good response so you all can guide me ahead.
Please give suggestions from where i could start working from??
Thank you!!

Regards,
Vishrut

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



Re: Getting Started-Introduction

2012-05-22 Thread kenneth gonsalves
On Tue, 2012-05-22 at 14:35 +0500, vishrut mehta wrote:
> I am Vishrut Mehta,studing Computer
> Sci  and Eng. BTech 2nd year.I was just getting started with
> contributing
> to Open Source Community.So wanted to start from the thing i love like
> developing softwares,apps,website,etc.I dont have any previous
> experience
> working in any open source org,this would be the first time,so i want
> you
> to help me move ahead.
> I am very enthusiatic with the things that interest me,love to write
> codes
> in python.
> I am looking forward for a good response so you all can guide me
> ahead.
> Please give suggestions from where i could start working from?? 

this might be of interest:

https://code.djangoproject.com/query?status=!closed&easy=1
-- 
regards
Kenneth Gonsalves

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



Different urls.py file for different apps

2012-05-22 Thread siddharth56660
Hi,
I am developing an ERP system which is vast and covers many modules.
After developing each module i create another app for second module
by
" django-admin.py startapp myapp2 "
This is perfectly working fine.
But my urls.py is growing very fast and has crossed more than 5000
lines with lot more to come.

Is there any other way in which i can make different urls.py as per my
apps.
I tried googling around but i dint find any way to give multiple apps
in setting.py file in ROOT_URLCONF entry.

Please help me around.

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



Re: Different urls.py file for different apps

2012-05-22 Thread Alexandr Aibulatov
you could include urls of app into your_app/urls.py

urlpatterns = patterns('',
   (r'your_app/', include('your_apps.urls'))
   (r'your_app2/', include('your_apps2.urls'))
   )

2012/5/22 siddharth56660 :
> Hi,
> I am developing an ERP system which is vast and covers many modules.
> After developing each module i create another app for second module
> by
> " django-admin.py startapp myapp2 "
> This is perfectly working fine.
> But my urls.py is growing very fast and has crossed more than 5000
> lines with lot more to come.
>
> Is there any other way in which i can make different urls.py as per my
> apps.
> I tried googling around but i dint find any way to give multiple apps
> in setting.py file in ROOT_URLCONF entry.
>
> Please help me around.
>
> --
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Different urls.py file for different apps

2012-05-22 Thread Andy McKay
Use include to pull in values from other apps inside your urls.py

https://docs.djangoproject.com/en/dev/topics/http/urls/#including-other-urlconfs

On Tue, May 22, 2012 at 11:49 AM, siddharth56660
 wrote:
> Hi,
> I am developing an ERP system which is vast and covers many modules.
> After developing each module i create another app for second module
> by
> " django-admin.py startapp myapp2 "
> This is perfectly working fine.
> But my urls.py is growing very fast and has crossed more than 5000
> lines with lot more to come.
>
> Is there any other way in which i can make different urls.py as per my
> apps.
> I tried googling around but i dint find any way to give multiple apps
> in setting.py file in ROOT_URLCONF entry.
>
> Please help me around.
>
> --
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Following multiple reverse relationships

2012-05-22 Thread akaariai
On May 22, 12:51 pm, sk <6b656...@gmail.com> wrote:
> If I have a hierarchy of models such that:
>
> class A(models.Model):
>     name = CharField(max_length=10)
>
> class B(models.Model):
>     name = CharField(max_length=10)
>     a= ForeignKey(A)
>
> class C(models.Model):
>     name = CharField(max_length=10)
>     b= ForeignKey(B)
>
> If I have an instance of C, as returned by:
>
> c = C.objects.get(pk=1)
>
> How do I get the name of A?
>
> I realise I can go via B, but I am hoping to be able to follow the
> chain back to A from any arbitrary point in (a much longer) chain.
>
> For example:
> If this was repeated up to F in an identical manner.
> If I pass a function any instance from A to F I would want to return
> A.name.
>
> I am sure there must be a simple way to get the root data, but I am
> having trouble finding it.

You really do have to go through the relations through the chain -
there is no direct links from C to A so it is impossible to just hop
from C to A.

You can query the A instance by something like
A.objects.filter(pk=B.objects.filter(pk=c.b_id)) - this should return
the A instance in one query. (It might be you will need to use
pk__in).

Or, you could use select_related or prefetch_related to do the
fetching.

 - Anssi

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



Static files management

2012-05-22 Thread Amr Abdel-wahab
I need the exact steps to have this thing working right because I tried
alot and its nt working

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



Re: Static files management

2012-05-22 Thread Xavier Ordoquy
Hi,

If you follow what the doc says, there shouldn't be any issue 
(https://docs.djangoproject.com/en/1.4/howto/static-files/#basic-usage)

Regards,
Xavier Ordoquy,
Linovia.

Le 22 mai 2012 à 15:31, Amr Abdel-wahab a écrit :

> I need the exact steps to have this thing working right because I tried alot 
> and its nt working
> 
> -- 
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

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



Re: Inserting HTML5 Coordinates Into Django Form

2012-05-22 Thread Timothy Makobu
If I understood your question correctly, using jQuery, I would use GMAP3
http://gmap3.net/ to get the the lat and long, store those in hidden form
fields, and submit that.
http://www.electrictoolbox.com/jquery-get-set-form-values/

MaxMind also have a free IP-to-City database, so
pygeoip.GeoIP().record_by_addr(request.META["REMOTE_ADDR"])['city'] tells
you the city of the client. (they are not exactly chained like that, but
you get the idea)

my Ksh 0.02


On Mon, May 21, 2012 at 9:10 PM, DF  wrote:

> I'm wading – carefully – into some basic geolocation using HTML5. I
> currently have a meta form that has space for lat and long coordinates and
> have found the proper code to obtain those coordinates using the Google
> Maps API (pretty simple stuff).
>
> Next step: inserting those coordinates automatically into the form. The
> application would ideally allow users to make posts and store their
> coordinates for future reference and filtering (this is a big endeavor one
> step at a time).
>
> I haven't yet explored mixing JavaScript with Django in this manner and
> was looking to see if there's a straightforward manner for doing this. Any
> resources, experience or expertise on this would be greatly appreciated. In
> the end, for context's sake, I would like users to have the ability to
> search for localized posts via the map and have the posts corresponding to
> the area display on screen.
>
> Thanks for any insight.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/CkxAVz64tgQJ.
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Russell Keith-Magee
Alexey - you have been warned. "Python Web Development" by Forcier,
Bissex and Chun is a copyrighted work. We *will not* condone any
attempt to use official Django forums as a way to circumvent
copyright.

Yours,
Russ Magee %-)

On Tue, May 22, 2012 at 5:28 PM, Alexey  wrote:
>
* LINK REDACTED 
>
> On 22 май, 09:05, Ali Shaikh  wrote:
>> Hey Django.!!
>>
>> Please can anyone share Python Web Development with
>> Django by Wesley Chun E-Book??
>>
>> Thank Yooo
>
> --
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-22 Thread Derek
Please read this:
https://code.djangoproject.com/wiki/UsingTheMailingList#Donts:
before continuing to post these types of messages.

On May 21, 3:30 pm, Aditya Sriram M  wrote:
> Some one there can answer!?
>
>
>
>
>
> On Sunday, 20 May 2012 13:12:17 UTC+5:30, Aditya Sriram M wrote:
>
> > Ooo.. Nice.
>
> > Hmm.. I tried this but it failed? Can you pls correct me?
>
> > def queryset(self, request):
> >         result = super(CustomerAdmin,
> > self).queryset(request).prefetch_related()
> >         return result
>
> > and my 'display list' for customer admin is..
>
> > list_display = ('get_user_name')
>
> > where definition of 'get_user_name' is
>
> > def get_user_name(self, obj):
> >         return u'%s %s %s' % (obj.customerid__first_name,
> > obj.customerid__middle_name, obj.customerid__last_name)
> > get_user_name.short_description = 'User Name'
>
> > where 'first_name', 'middle_name' etc are properties of the 'User' model.
>
> > Regards,
> > Aditya
>
> > On Sunday, 20 May 2012 07:12:54 UTC+5:30, Matt Schinckel wrote:
>
> >> You may be able to use prefetch_related to do what you want: it will all
> >> depend upon your model structure. select_related is easier, but only
> >> follows an fk in one direction.
>
> >> Matt.
>
> >> On Sunday, May 20, 2012 12:27:57 AM UTC+9:30, Aditya Sriram M wrote:
>
> >>> Hi,
>
> >>> again, my models are Customer, Users and Devices.
>
> >>> I would like to search by Customer and retrieve all 'select_related'
> >>> rows of all the three models.
> >>> Eg. like this..
>
> >>> Customer1 User1 Device1
> >>> Customer1 User1 Device2
> >>> Customer1 User2 Device1
> >>> Customer1 User2 Device2
> >>> etc etc..
>
> >>> Is this possible in Django? If so how?

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



Re: Getting Started-Introduction

2012-05-22 Thread vishrut mehta
Thank you a lo..! But i tld u im a bit new to all this...Can u
please explain how to solve bugs and submit the patches,means the procedure
??I am just new to this...

On Tue, May 22, 2012 at 3:54 PM, kenneth gonsalves
wrote:

> On Tue, 2012-05-22 at 14:35 +0500, vishrut mehta wrote:
> > I am Vishrut Mehta,studing Computer
> > Sci  and Eng. BTech 2nd year.I was just getting started with
> > contributing
> > to Open Source Community.So wanted to start from the thing i love like
> > developing softwares,apps,website,etc.I dont have any previous
> > experience
> > working in any open source org,this would be the first time,so i want
> > you
> > to help me move ahead.
> > I am very enthusiatic with the things that interest me,love to write
> > codes
> > in python.
> > I am looking forward for a good response so you all can guide me
> > ahead.
> > Please give suggestions from where i could start working from??
>
> this might be of interest:
>
> https://code.djangoproject.com/query?status=!closed&easy=1
> --
> regards
> Kenneth Gonsalves
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Thomas Lockhart

On 5/22/12 6:46 AM, Russell Keith-Magee wrote:

... We *will not* condone any
attempt to use official Django forums as a way to circumvent
copyright.


Thanks Russell!

- Tom

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



Re: ordering m2m query based on through table

2012-05-22 Thread akaariai
On May 22, 7:14 am, KentH  wrote:
> I am trying to configure a m2m relationship to be ordered based on data in
> the through table. I assumed an 'order' attribute in the through-table's
> Meta class would be honored, but it's not. Bug #11850 (closed: wontfix)
> relates to this problem, but with no pointer as to a work-around.
>
> As custom ordering would seem a prime use case for a custom through class
> on m2m relations, I'm surprised how hard it is.
>
> In my case, I'm trying to order digital assets (eg sheet music) into a
> number of folios (collections). Music can appear in several collections.
> Order is manually specified for each collection. An attribute in a custom
> through table is a natural solution, but it doesn't work.
>
> Other examples which come to mind: Authors and books, or songs and
> composers. Since books are alphabetized by lead author, the order matters.
> And we wouldn't want Django to list "Lennon & McCartney" songs  as "McCartney
> & Lennon"
>
> Anyway, how is the best way to crack this nut? After studying
> `db.models.related` I tried building a custom manager on the related class,
> and override the `get_query_set` method to look for the through attribute
> on the manager to update the ordered_by clause. No luck -- but with
> prefetch interaction, this seems pretty fragile in any case.
>
> Thanks for any help.
>
> Kent.

So, you would want to do collection.songs.all() and have that ordered
by the sequence defined in the m2m table? I agree - this seems to be
somewhat hard currently. You would need to do [t.song for t in
Through.objects.filter(collection=collection).order_by('seq').select_related('song')]
or something like that... It might be nice if the related manager of
collection would have a special lookup 'through', so you could to
collection.songs.all().select_related('through'), or
collection.songs.all().order_by('through__seq'). But it would be
somewhat messy to do that currently. Implementing better custom
lookups could make this easier to implement.

 - Anssi

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



Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-22 Thread akaariai
On May 22, 5:10 pm, Derek  wrote:
> Please read 
> this:https://code.djangoproject.com/wiki/UsingTheMailingList#Donts:
> before continuing to post these types of messages.

In addition, doing a "django prefetch_related" search on Google might
lead to some clues here...

 - Anssi

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



Re: Getting Started-Introduction

2012-05-22 Thread Andre Terra
https://docs.djangoproject.com/en/dev/internals/contributing/

On Tue, May 22, 2012 at 11:17 AM, vishrut mehta
wrote:

> Thank you a lo..! But i tld u im a bit new to all this...Can u
> please explain how to solve bugs and submit the patches,means the procedure
> ??I am just new to this...
>
> On Tue, May 22, 2012 at 3:54 PM, kenneth gonsalves  > wrote:
>
>> ...
>>
>

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



Django site updater

2012-05-22 Thread kooliah
I'm working on a new site and i have often the need to update the server 
to let other people see the progress.
I tought to do a python script that compare the file structure/date/time 
of my local version with the server version and update only the 
changed/new files.
Before starting, and according to the DRY principle :-), I would like to 
know if there is already something like that.


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



Re: Django site updater

2012-05-22 Thread Aaron C. de Bruyn
Sounds like you might benefit from Fabric.
Fabric lets you define a repeatable process (in Python) for deploying
your website to a server.

-A

On Tue, May 22, 2012 at 1:17 PM, kooliah
 wrote:
> I'm working on a new site and i have often the need to update the server to
> let other people see the progress.
> I tought to do a python script that compare the file structure/date/time of
> my local version with the server version and update only the changed/new
> files.
> Before starting, and according to the DRY principle :-), I would like to
> know if there is already something like that.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



After python upgrade, User.objects.get(username= doesn't work consistently

2012-05-22 Thread Hanne Moa
I upgraded python to 2.6.8 today from an earlier 2.6, what an
adventure! So much bizarre happenings so many places. Tonight's
special:

SomeModel.objects.get(sometextfield=sometext) always works (when there
is one entry where sometextfield=sometext of course).

auth.User.objects.get(username=sometext) works only *sometimes*.

In a login-view, I first check that the user for a given username
exists. It does! User found. Then I try to authenticate:
auth.authenticate(user.username, password). That never works!
Monkeypatching authenticate() shows that the
User.objects.get(username=username) in it always returns
User.DoesNotExist. But of course:
User.objects.filter(username__startswith=username).get(username__endswith=username)
always return the user in question. And the only thing that has
changed is the minor python version.

I can't get User.objects.get(username=whatever) to work in the shell either.

How do I debug this further? This is for django 1.3, I need to have
this working predictably again before I can upgrade to 1.4. I have
logs of the sql if that'll help but the sql looks fine.


HM

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



Re: After python upgrade, User.objects.get(username= doesn't work consistently

2012-05-22 Thread Kurtis Mullins
Hey,

Sorry I'm a bit confused so I'm going to try to make some sense of
your situation "out loud" :)

1. User.objects.get(username="some_username") works some-times
2. When it doesn't work, then you get the DoesNotExist exception, right?
3. If not, what error(s) do you see?
4. Are you sure the user, with that username, does exist when you get
the exception?
5. If you are sure they exist and you still get the exception, did you
look into the database itself to see if it exists? Or how did you come
to this conclusion?

On Tue, May 22, 2012 at 4:49 PM, Hanne Moa  wrote:
> I upgraded python to 2.6.8 today from an earlier 2.6, what an
> adventure! So much bizarre happenings so many places. Tonight's
> special:
>
> SomeModel.objects.get(sometextfield=sometext) always works (when there
> is one entry where sometextfield=sometext of course).
>
> auth.User.objects.get(username=sometext) works only *sometimes*.
>
> In a login-view, I first check that the user for a given username
> exists. It does! User found. Then I try to authenticate:
> auth.authenticate(user.username, password). That never works!
> Monkeypatching authenticate() shows that the
> User.objects.get(username=username) in it always returns
> User.DoesNotExist. But of course:
> User.objects.filter(username__startswith=username).get(username__endswith=username)
> always return the user in question. And the only thing that has
> changed is the minor python version.
>
> I can't get User.objects.get(username=whatever) to work in the shell either.
>
> How do I debug this further? This is for django 1.3, I need to have
> this working predictably again before I can upgrade to 1.4. I have
> logs of the sql if that'll help but the sql looks fine.
>
>
> HM
>
> --
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django site updater

2012-05-22 Thread Kurtis Mullins
We use a versioning system (Subversion to be precise, git or mercurial
would probably be better for you). Then I commit everything to the
main repository and just checkout (update after the initial checkout)
on the development server. It's not too bad of a system although I
still have to go onto the server and type in "svn update" all of the
time (plus /etc/init.d/uwsgi restart since I run it behind nginx)

On Tue, May 22, 2012 at 4:27 PM, Aaron C. de Bruyn  wrote:
> Sounds like you might benefit from Fabric.
> Fabric lets you define a repeatable process (in Python) for deploying
> your website to a server.
>
> -A
>
> On Tue, May 22, 2012 at 1:17 PM, kooliah
>  wrote:
>> I'm working on a new site and i have often the need to update the server to
>> let other people see the progress.
>> I tought to do a python script that compare the file structure/date/time of
>> my local version with the server version and update only the changed/new
>> files.
>> Before starting, and according to the DRY principle :-), I would like to
>> know if there is already something like that.
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django site updater

2012-05-22 Thread Tanuva
You could checkout your project from the repository onto the server -
assuming you are using version control. Alternatively, you might like rsync.

Marcel

Am 22.05.2012 22:17, schrieb kooliah:
> I'm working on a new site and i have often the need to update the server
> to let other people see the progress.
> I tought to do a python script that compare the file structure/date/time
> of my local version with the server version and update only the
> changed/new files.
> Before starting, and according to the DRY principle :-), I would like to
> know if there is already something like that.
> 

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



"Connection refused" with backend psycopg2

2012-05-22 Thread Tanuva
Moin,

lately, I wanted to switch my database from the testing sqlite file to a
more productive pgsql 8.4 server. Now I'm constantly getting a
"connection refused" from the psycopg2 backend: http://dpaste.org/0Ezka/
Database configuration: http://dpaste.org/QPjD2/ (not that verbose...)

Funny enough, connecting manually using psycopg2 in a python2 shell and
using pgadmin to confirm changes done there works just fine, so there
must be something in between.

What information might help you help me helping myself? ;)

Marcel

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



Re: Static files management

2012-05-22 Thread Kurtis Mullins
Can you give us some more detail on what's not working? Thanks.

On Tue, May 22, 2012 at 9:34 AM, Xavier Ordoquy  wrote:
> Hi,
>
> If you follow what the doc says, there shouldn't be any issue 
> (https://docs.djangoproject.com/en/1.4/howto/static-files/#basic-usage)
>
> Regards,
> Xavier Ordoquy,
> Linovia.
>
> Le 22 mai 2012 à 15:31, Amr Abdel-wahab a écrit :
>
>> I need the exact steps to have this thing working right because I tried alot 
>> and its nt working
>>
>> --
>> 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 more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>
> --
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Time zone support enabled in Django 1.4, yet "Django does not support timezone-aware times"

2012-05-22 Thread Ramiro Morales
On Mon, May 21, 2012 at 9:57 PM, Arthur  wrote:
> Hello,
>
> I recently upgraded one of my machines to Django 1.4 to patch a bug related
> to the use of PostGIS 9.1. I read the documentation on the new support for
> time zones and added USE_TZ=True to my settings.py file. Nonetheless, when I
> attempt to load data into my PostGIS database in one of the following ways,
> I receive a ValueError: Django does not support timezone-aware times.

If what you did in that machine is upgrade to Django 1.4 from an older version
then you might be victim of a problem because of whcih the files form the
previous installation aren't overwritten and you end with a broken mix of
things.

The documentation has recently been [1]amended with instructions on how
to avoid this. Please use the [2]updated section in the relevant document.

HTH

-- 
Ramiro Morales

1. 
https://github.com/django/django/commit/6ed7d40727f70934df6ab0ac96f5f1c4f01c534f
2. 
https://docs.djangoproject.com/en/dev/topics/install/#remove-any-old-versions-of-django

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



Re: "Connection refused" with backend psycopg2

2012-05-22 Thread akaariai
On May 22, 11:51 pm, Tanuva  wrote:
> Moin,
>
> lately, I wanted to switch my database from the testing sqlite file to a
> more productive pgsql 8.4 server. Now I'm constantly getting a
> "connection refused" from the psycopg2 backend:http://dpaste.org/0Ezka/
> Database configuration:http://dpaste.org/QPjD2/(not that verbose...)
>
> Funny enough, connecting manually using psycopg2 in a python2 shell and
> using pgadmin to confirm changes done there works just fine, so there
> must be something in between.
>
> What information might help you help me helping myself? ;)

I would take a wild guess that this is related to pg_hba.conf. Is the
database on the localhost? If so, can you connect to it using 'psql -d
thedb', but not with 'psql -d thedb -h www0.com -U
the_user_in_settings'.

 - Anssi

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



Re: After python upgrade, User.objects.get(username= doesn't work consistently

2012-05-22 Thread Hanne Moa
On 22 May 2012 22:58, Kurtis Mullins  wrote:
> Sorry I'm a bit confused so I'm going to try to make some sense of
> your situation "out loud" :)
>
> 1. User.objects.get(username="some_username") works some-times

Yes.

> 2. When it doesn't work, then you get the DoesNotExist exception, right?

Yes.

> 3. If not, what error(s) do you see?

I haven't tried it on non-existing users. I except to get a user back.

> 4. Are you sure the user, with that username, does exist when you get
> the exception?

Yes. The user exists if I do an objects.all() or startswith/endswith.
I can do User.objects.get(id=... and get the user I want, i just can't
look em up by username.

> 5. If you are sure they exist and you still get the exception, did you
> look into the database itself to see if it exists? Or how did you come
> to this conclusion?

In a view I run User.objects.gte() by hand, then the user exists, then
a handful of lines later, still in the same view, User.objects.get()
for the same user is run by authenticate() (default ModelBackend) but
then the user does not exist. The database does not change in the
meantime.

The odd thing is it's only the auth.User model that shows this. Other
models are fine.


HM

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



Re: After python upgrade, User.objects.get(username= doesn't work consistently

2012-05-22 Thread akaariai
On May 22, 11:49 pm, Hanne Moa  wrote:
> I upgraded python to 2.6.8 today from an earlier 2.6, what an
> adventure! So much bizarre happenings so many places. Tonight's
> special:
>
> SomeModel.objects.get(sometextfield=sometext) always works (when there
> is one entry where sometextfield=sometext of course).
>
> auth.User.objects.get(username=sometext) works only *sometimes*.
>
> In a login-view, I first check that the user for a given username
> exists. It does! User found. Then I try to authenticate:
> auth.authenticate(user.username, password). That never works!
> Monkeypatching authenticate() shows that the
> User.objects.get(username=username) in it always returns
> User.DoesNotExist. But of course:
> User.objects.filter(username__startswith=username).get(username__endswith=username)
> always return the user in question. And the only thing that has
> changed is the minor python version.
>
> I can't get User.objects.get(username=whatever) to work in the shell either.
>
> How do I debug this further? This is for django 1.3, I need to have
> this working predictably again before I can upgrade to 1.4. I have
> logs of the sql if that'll help but the sql looks fine.

Please provide these three things for further debugging:
  - the exact Python code you try in the shell (including a real
username).
  - the SQL that generates (when not working).
  - what does happen when you try to run that SQL in manage.py dbshell
(you might need to add quotes to the parameters)

 - Anssi

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



Slideshare API

2012-05-22 Thread Amr Abdel-wahab
Anyone here ever dealt with slideshare API in a django project and know how
exactly to use it

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



Re: "Connection refused" with backend psycopg2

2012-05-22 Thread Tanuva
Am 22.05.2012 23:52, schrieb akaariai:
> On May 22, 11:51 pm, Tanuva  wrote:
>> Moin,
>>
>> lately, I wanted to switch my database from the testing sqlite file to a
>> more productive pgsql 8.4 server. Now I'm constantly getting a
>> "connection refused" from the psycopg2 backend:http://dpaste.org/0Ezka/
>> Database configuration:http://dpaste.org/QPjD2/(not that verbose...)
>>
>> Funny enough, connecting manually using psycopg2 in a python2 shell and
>> using pgadmin to confirm changes done there works just fine, so there
>> must be something in between.
>>
>> What information might help you help me helping myself? ;)
> 
> I would take a wild guess that this is related to pg_hba.conf. Is the
> database on the localhost? If so, can you connect to it using 'psql -d
> thedb', but not with 'psql -d thedb -h www0.com -U
> the_user_in_settings'.
> 
>  - Anssi
> 

No, the db is not running on localhost, the machine sits in some
datacentre. On that db server, your first command indeed doesn't work.
Sadly that doesn't tell us much now I guess. The second one works fine
both on the machine and here on my local box.

Marcel

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



Re: "Connection refused" with backend psycopg2

2012-05-22 Thread Stanwin Siow


On May 23, 2012, at 1:41 PM, Tanuva wrote:

> Am 22.05.2012 23:52, schrieb akaariai:
>> On May 22, 11:51 pm, Tanuva  wrote:
>>> Moin,
>>> 
>>> lately, I wanted to switch my database from the testing sqlite file to a
>>> more productive pgsql 8.4 server. Now I'm constantly getting a
>>> "connection refused" from the psycopg2 backend:http://dpaste.org/0Ezka/
>>> Database configuration:http://dpaste.org/QPjD2/(not that verbose...)
>>> 
>>> Funny enough, connecting manually using psycopg2 in a python2 shell and
>>> using pgadmin to confirm changes done there works just fine, so there
>>> must be something in between.
>>> 
>>> What information might help you help me helping myself? ;)
>> 
>> I would take a wild guess that this is related to pg_hba.conf. Is the
>> database on the localhost? If so, can you connect to it using 'psql -d
>> thedb', but not with 'psql -d thedb -h www0.com -U
>> the_user_in_settings'.
>> 
>> - Anssi
>> 
> 
> No, the db is not running on localhost, the machine sits in some
> datacentre. On that db server, your first command indeed doesn't work.
> Sadly that doesn't tell us much now I guess. The second one works fine
> both on the machine and here on my local box.
> 
> Marcel

I had the same problem when i was working on a school project. I informed my 
supervisor and he restarted the servers which solved the problem.

I don't know if that may solve your problem but do be careful because i believe 
you are dealing with production servers.

Just my two cents worth.

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

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



Re: "Connection refused" with backend psycopg2

2012-05-22 Thread akaariai
On May 23, 8:41 am, Tanuva  wrote:
> Am 22.05.2012 23:52, schrieb akaariai:
>
>
>
>
>
>
>
>
>
> > On May 22, 11:51 pm, Tanuva  wrote:
> >> Moin,
>
> >> lately, I wanted to switch my database from the testing sqlite file to a
> >> more productive pgsql 8.4 server. Now I'm constantly getting a
> >> "connection refused" from the psycopg2 backend:http://dpaste.org/0Ezka/
> >> Database configuration:http://dpaste.org/QPjD2/(notthat verbose...)
>
> >> Funny enough, connecting manually using psycopg2 in a python2 shell and
> >> using pgadmin to confirm changes done there works just fine, so there
> >> must be something in between.
>
> >> What information might help you help me helping myself? ;)
>
> > I would take a wild guess that this is related to pg_hba.conf. Is the
> > database on the localhost? If so, can you connect to it using 'psql -d
> > thedb', but not with 'psql -d thedb -h www0.com -U
> > the_user_in_settings'.
>
> >  - Anssi
>
> No, the db is not running on localhost, the machine sits in some
> datacentre. On that db server, your first command indeed doesn't work.
> Sadly that doesn't tell us much now I guess. The second one works fine
> both on the machine and here on my local box.

Maybe the psql -d thedb should not work. On the db server you should
probably add -U  in there.

Maybe the 'sslmode': 'require' is causing this problem? You can try if
this is causing problem by:
export SSLMODE=required
psql -U -h -p 5432 
or by just removing the sslmode from your database settings and trying
again.

The error you are getting is the same you get if you would try to
connect to a machine with no postgres installation at all. So, one
possibility is that your host or port are not correct for some reason.

 - Anssi

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



Re: "Connection refused" with backend psycopg2

2012-05-22 Thread kenneth gonsalves
On Tue, 2012-05-22 at 22:51 +0200, Tanuva wrote:
> lately, I wanted to switch my database from the testing sqlite file to
> a
> more productive pgsql 8.4 server. Now I'm constantly getting a
> "connection refused" from the psycopg2 backend:
> http://dpaste.org/0Ezka/
> Database configuration: http://dpaste.org/QPjD2/ (not that verbose...)
> 
> Funny enough, connecting manually using psycopg2 in a python2 shell
> and
> using pgadmin to confirm changes done there works just fine, so there
> must be something in between. 

edit your pg_hba.conf file for suitable permissions
-- 
regards
Kenneth Gonsalves

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



Is there a custom forms component of python-web?

2012-05-22 Thread kevon wang
I have these requires:
1,Customers can configure form's columns, the name and quantity of columns
can been configured.
2,After customers configured form's columns, program automatic create the
table of corresponding form.
3,After table created, customers can CURD the table.

So I want to know whether there is a custom forms component or example of
python-web, the best one can match django framework.  thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



JQuery Django

2012-05-22 Thread cocoza4
i'm new to Django. How can i connect jQuery with DJango?

is there any tool to help me do this?
please show me the sample code also

thanks in advance

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



JQuery Django

2012-05-22 Thread cocoza4
I'm new to Django.
How can i connect Django with jQuery?

is there any additional tool that i need to install?

could you show me a sample code also?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/OIGnCdgMJooJ.
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: JQuery Django

2012-05-22 Thread Stanwin Siow

On May 23, 2012, at 2:06 PM, cocoza4 wrote:

> I'm new to Django.
> How can i connect Django with jQuery?
> 
> is there any additional tool that i need to install?
> 
> could you show me a sample code also?
> 
> Thanks in advance.
> 
All you need to do is to insert the jquery code into the html pages that 
require jquery.
Remember to add the jquery file at the top
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/OIGnCdgMJooJ.
> 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 more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

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