Re: Issue Deploying Django

2012-07-31 Thread kenneth gonsalves
On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote: > Do I need to go through and install the python like adapters is that > what it's complaining about? I don't think this has to do with my > Django code on the server it's just a file missing right? you need to install pycopg - and it is nothing

Re: Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread Mike Dewhirst
Yesterday I did ... pip install --upgrade django ... and it happily upgraded mine to 1.4.1 Mike On 1/08/2012 9:46am, Dennis Lee Bieber wrote: On Tue, 31 Jul 2012 16:06:20 -0700 (PDT), JJ Zolper declaimed the following in gmane.comp.python.django.user: Nope. Not Python 1.4. Django 1.4.

django-allauth and signup or login via twitter?

2012-07-31 Thread HL
I am trying to work with django-allauth. I followed the instructions at github page and done following: 1. Added allauth urls into urls.py urlpatterns += patterns ('', > url('^accounts/', include('allauth.urls')), > url('^accounts/profile/$',

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Wed, Aug 1, 2012 at 8:45 AM, Lachlan Musicman wrote: > On Wed, Aug 1, 2012 at 12:43 AM, Melvyn Sopacua wrote: > >> On 31-7-2012 6:17, Lachlan Musicman wrote: >> >> > I have Person, Certificate, Job and Compensation objects. The last three >> > all >> > have an FK (or M2M) back to a (or some) P

Detecting browser type after login

2012-07-31 Thread Larry Martell
I've only been working with django for 6 months, and I'm not really clear on how the login process works. I have a client that has a login screen created by a template. It has a submit button with: In their urls file they have: (r'^accounts/login/$', login) In their views file they call login

Re: Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread JJ Zolper
Nope. Not Python 1.4. Django 1.4. http://pypi.python.org/pypi/Django/1.4#downloads I ran the following commands in the python interpreter and saw the following: >>> import django >>> print django.get_version() 1.4 I'm good to go. Not sure if the 1.4.1 file off of djangoproject.com is in the ri

Re: returning a zip file for download

2012-07-31 Thread Javier Guerra Giraldez
On Tue, Jul 31, 2012 at 5:03 PM, Tomas Neme wrote: > The weird thing is that I'm getting just a pdf file (ok, I'm testing with a > single file, so I don't know if that's the problem) shoot in the dark: maybe the browser is interpreting the zipped PDF as a zip-encoded response, and decoding it for

Re: Problem with order_by on one record only

2012-07-31 Thread Alex Umrysh
Just to update this in case anyone else has a similar problem... I used a DecimalField where the database had a Float value, so I switched it to a FloatField in my models and it fixed the problem. Of course, some precision may be lost in doing this, but considering the values I'm reading are ac

Re: MySQL total overheat (somewhat complex database)

2012-07-31 Thread lubos
Hello, I forgot to mention, that this query is generated automatically by Django admin when opening this model admin page. Dne pondělí, 30. července 2012 14:53:10 UTC+2 Cal Leeming [Simplicity Media Ltd] napsal(a): > > Could you provide us with the models.py for this table? Just the model > de

Re: Weird test-behaviour in combination with localization

2012-07-31 Thread Andre Schemschat
Ok, so I fixed my problem, but i have the feelings this cant really be a longterm solution ^^. If i create my own testsuite and skip all django-apps, the tests pass, if i comment them in, they wont run (With the above error). is there a possibility django changes the language-settings somehow w

Re: returning a zip file for download

2012-07-31 Thread Nikolas Stevenson-Molnar
I'm not sure why you're getting a PDF file back, but as for the filename, you can set it using the Content-Disposition header. E.g: response = return HttpResponse(open(tmp[1]), mimetype="application/zip") response['Content-Disposition'] = 'attachment; filename="whatever.zip' return response _Nik

combobox prepopulated to only related objects to "self"

2012-07-31 Thread Ignacio Soto
Hi everyone i have this model GROUP and Product product has a group field thath is foreignkey to GROUP. and Group has foreignKey to Product to select primary product. so i want to have a group with many products and one is the "primary product". so...i could do this by select inline produ

returning a zip file for download

2012-07-31 Thread Tomas Neme
Down here's the code in which I'm creating a zip file with a bunch of pdf labels, and returning it on the HttpResponse for the user to DL it. The weird thing is that I'm getting just a pdf file (ok, I'm testing with a single file, so I don't know if that's the problem) and I can't set the download

Re: No timezone support for TimeField?

2012-07-31 Thread Thomas Lockhart
On 7/31/12 1:34 PM, Tejinder Singh wrote: Django 1.4 does not store aware times for TimeField, it only does for DateTimeField. Its really annoying, as python datetime.time object does support TZINFO just like datetime.datetime objects. I wonder if it is a bug? Btw i have tested it on postgres 9

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Wed, Aug 1, 2012 at 12:43 AM, Melvyn Sopacua wrote: > On 31-7-2012 6:17, Lachlan Musicman wrote: > > > I have Person, Certificate, Job and Compensation objects. The last three > > all > > have an FK (or M2M) back to a (or some) Person(s). > > > > So reverse relations. > Yep, thanks - with Djan

No timezone support for TimeField?

2012-07-31 Thread Tejinder Singh
Django 1.4 does not store aware times for TimeField, it only does for DateTimeField. Its really annoying, as python datetime.time object does support TZINFO just like datetime.datetime objects. I wonder if it is a bug? Btw i have tested it on postgres 9.1 database server -- You received this m

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Tue, Jul 31, 2012 at 11:15 PM, Karl Sutt wrote: > So, in conclusion, Lachlan, you would want to do something like: > > def get_context_data(self,**kwargs): >> #Call the base implementation first to get a context >> context = super(PersonDetailView, self).get_context_data(**kwa

Weird test-behaviour in combination with localization

2012-07-31 Thread Andre Schemschat
Hey together, I was just writing some tests for my views and i stumbled upon a localization error, which i cant figure out :/ I have a test that checks the form-validation returnes the correct errors-messages for specific input data. Basicly what i feed to the view are the field-names and their

Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-07-31 Thread Anton Baklanov
what is going on here: self.base_fields = fields_for_a(self.instance) ? On Tue, Jul 31, 2012 at 8:14 PM, Nick_B wrote: > Hi, > > Have hit a huge roadblock trying to implement a custom, dynamic form into > my django project. Although I am more familiar with using ModelForms, I > need to use

Re: Form validation using model data?

2012-07-31 Thread Kurtis Mullins
ahh okay, then I simply create two model forms. class CreateURLForm(ModelForm): class Meta: fields = ('url', 'name') # This will restrict the user to only modifying this data model = URLModel # Or whatever your model is called class UpdateURLForm(ModelForm): class Meta:

Working with a Custom, Dynamic Form (using BaseForm)

2012-07-31 Thread Nick_B
Hi, Have hit a huge roadblock trying to implement a custom, dynamic form into my django project. Although I am more familiar with using ModelForms, I need to use BaseForm to work with the structure I already have in place. I have a dictionary of objects inside of my Model 'Photographer' that I

Catch or raise exception designissue

2012-07-31 Thread Ian Clelland
[sorry for the late response; this got lost in drafts, but it's enough of a sore point for me to want to post it] On Sun, Jul 15, 2012 at 12:30 PM, Jani Tiainen > wrote: > I think "letting to explode" is all about coloring the bike shed. It all > depends on a API contract - if parameter is requi

Re: presenting a manytomany relationship in a tabular way

2012-07-31 Thread Melvyn Sopacua
On 31-7-2012 11:33, goabbear wrote: > There's 3 tables, user(name, mail), mailinglist(name) and an intermediate > table subscription where are stored all the users joining some > mailinglists. > How can I present the "subscription" table to the admins like a > spreadsheet, where the first colu

Re: Exlude xampp-htdocs-projects from beeing treated as Django projects?

2012-07-31 Thread Melvyn Sopacua
On 31-7-2012 11:33, AnotherGuyver wrote: > The Django installation seems to work allright. However, > when I switch to my other projects, which don't use Django, e.g. > loclhost/project1, they're still treated as Django Projects or at least the > Django welcome page is beeing displayed instead o

Re: merge data from multiple models

2012-07-31 Thread Melvyn Sopacua
On 31-7-2012 14:36, Joris wrote: > class SlowModel(models.Model): > rid_fastmodel = models.IntegerField(primary_key=True) > calcfield1 = models.TextField(blank=True) > calcfield2= models.TextField(blank=True) > > SQLstatement = "SELECT rid_fastmodel, calcfield1, calcfield2 from (SEL

Re: Adding more data to Generic Views

2012-07-31 Thread Melvyn Sopacua
On 31-7-2012 6:17, Lachlan Musicman wrote: > I have Person, Certificate, Job and Compensation objects. The last three > all > have an FK (or M2M) back to a (or some) Person(s). > So reverse relations. > def get_context_data(self,**kwargs): > #Call the base implementation first to ge

Re: access the state of a Model object prior to it's modification ?

2012-07-31 Thread Nicolas Emiliani
On Mon, Jul 30, 2012 at 6:22 PM, Tomas Neme wrote: > > uhm, if you register a listener to the pre_save signal, then you can do > this: > > > if instance.published: > # the instance about to be saved has the published flag on > dbojb = MyModel.objects.get(id=instance.id) > > # did it have it

Re: merge data from multiple models

2012-07-31 Thread Joris
> Hmm, I guess I'm missing the "real world use case" for this. Most > importantly, I'm missing how this slow model relates to the fast model > and what kind of query it is executing. I'm especially curious about the > "as this statement is executed as an instance of the model" bit. Ok, I'll t

Re: merge data from multiple models

2012-07-31 Thread Melvyn Sopacua
On 30-7-2012 19:50, joris benschop wrote: > > > Op maandag 30 juli 2012 16:06:38 UTC+2 schreef Joris het volgende: >> >> >> >> On Monday, July 30, 2012 3:52:31 PM UTC+2, Melvyn Sopacua wrote: >>> >>> >>> If this is not implemented as a OneToOneField, then do so. You can then >>> access the relat

Exlude xampp-htdocs-projects from beeing treated as Django projects?

2012-07-31 Thread AnotherGuyver
Hey guys, I'm using XAMPP and I'm pretty new to Django, so I followed this tutorial to get me started. The Django installation seems to work allright. However, when I switch to my other projects, which don't use Django, e.g. loclhost/project1, they'r

presenting a manytomany relationship in a tabular way

2012-07-31 Thread goabbear
Hi all, I start with django but after some searches I can't do what I want in the admin section of my app. There's 3 tables, user(name, mail), mailinglist(name) and an intermediate table subscription where are stored all the users joining some mailinglists. How can I present the "subscription"

Re: Dynamic forms

2012-07-31 Thread Satinder Goraya
On Tue, Jul 31, 2012 at 1:23 AM, Sandeep kaur wrote: > I want to have a form, with drop down list and then multiple select > checkboxes dynamically filtered based on drop down selection. I have > searched a lot but did not find a complete solution for my > requirement. Also I want to ask that can

Re: Adding more data to Generic Views

2012-07-31 Thread Karl Sutt
So, in conclusion, Lachlan, you would want to do something like: def get_context_data(self,**kwargs): > #Call the base implementation first to get a context > context = super(PersonDetailView, self).get_context_data(**kwargs) > #Add in a querysets > context['job_li

Re: merge data from multiple models

2012-07-31 Thread Jirka Vejrazka
Hi there, > As templates cannot do lookups into a dictionary Templates can do lookups into a dictionary, see https://docs.djangoproject.com/en/1.4/topics/templates/#variables (check the "Behind the scenes" section). From what you've described, I'd try to prepare the necessary data in a v

Re: Adding more data to Generic Views

2012-07-31 Thread Per-Olof Åstrand
Hi, I just started to convert my small hobby-project into class-based views and struggled with similar things (but with a ListView instead). The person object is in the context dictionary, so you need to refer to it by context['person']. More generally, it is instructive to print context, kwar

Re: Plotting a line graph

2012-07-31 Thread Sithembewena Lloyd Dube
Hi Kevin, Does what I need, thanks :) On Mon, Jul 30, 2012 at 5:05 PM, Kevin Anthony wrote: > I would look into the Google graph API > https://developers.google.com/chart/ > > On Mon, Jul 30, 2012 at 10:47 AM, Sithembewena Lloyd Dube < > zebr...@gmail.com> wrote: > >> Hi all, >> >> I need to dra

Re: Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread JJ Zolper
Okay I'm sure it's fine but I was able to get a hold of 1.4 from python.org and I used that when installing Django to my server on bluehost.com for the time being I'm going to go with that. Each time I tried to run the command on there after having downloaded the 1.4.1 file from https://www.djan

Re: Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread James Bennett
On Tue, Jul 31, 2012 at 2:42 AM, JJ Zolper wrote: > What about if you download it from the link I put. When I said "I downloaded a copy of the 1.4.1 tarball", that's exactly what I meant. django.get_version() prints '1.4.1'. I do not know what the problem is with your local install, but I can ve

Re: Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread JJ Zolper
What about if you download it from the link I put. I mean I'm sure it's fine just pointing out that where I got it from it said 1.5 On Tuesday, July 31, 2012 3:30:31 AM UTC-4, James Bennett wrote: > > On Tue, Jul 31, 2012 at 2:15 AM, JJ Zolper wrote: > import django > print django.g

Re: Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread James Bennett
On Tue, Jul 31, 2012 at 2:15 AM, JJ Zolper wrote: import django print django.get_version() > > I didn't see 1.4.1 I saw 1.5 > > Sure it's probably a minor configuration fix to change it to 1.4.1 but I was > really worried that I did something wrong. > > Maybe someone else can repeat this

Error in Brand New Django 1.4.1 released Yesterday

2012-07-31 Thread JJ Zolper
Hello all, I didn't realize a new release was put out until something weird happened. I'm installing DJ on my production server now and when I was downloading a copy from https://www.djangoproject.com/download/ and installed it and went into python: >>> import django>>> print django.get_versio