Re: Getting into professional django development

2011-10-20 Thread Kevin
I have a similar development machine set-up, for hosting, I am currently using Rackspace Cloud, as I have full control over deployment options, and it can grow with my apps, scalability is a must. I am currently using Debian Squeeze and editing with the wonderful Kate, and using KIO to edit the od

Integrating facebook canvas with django

2011-10-20 Thread Amit Sethi
Hi all , I have to integrate a few django apps with facebook without having to do a major code change on the django apps side. One of the things that I need is to do is to replace django's user backend such that it uses the facebook authentication mechanism .But at same time be able to use other t

Re: Blank output from treemenus under nginx

2011-10-20 Thread Kevin
Something you may want to try to see if it is fastcgi related, is running the site on the server in dev mode, plain old manage.py runserver. Then replace your fastCGI command in nginx with proxy_pass http://127.0.0.1:8000/; Be sure to change nginx and reload it's config before running manage.py ru

Re: Django admin multiple company accounts

2011-10-20 Thread Kevin
There is no need to implement the same CRUD over and over again with the help of generic views and signals. :) https://docs.djangoproject.com/en/1.3/ref/class-based-views/ Mind you, I've only used these generic views in 1.2 and never yet took some time to learn the new class-based one. Although

Re: default form template

2011-10-20 Thread bino oetomo
On 10/21/2011 10:49 AM, bino oetomo wrote: On 10/21/2011 10:31 AM, Venkatraman S wrote: https://docs.djangoproject.com/en/dev/topics/forms/#displaying-a-form-using-a-template For inserting javascript, why you have to 'extend'; use jquery and do the needful with the form! Kindly please giv

Re: default form template

2011-10-20 Thread bino oetomo
On 10/21/2011 10:31 AM, Venkatraman S wrote: Its Django :) (though we call it as 'django'(with 'd' being silent). Hahaha ... I Apologize for my typo. https://docs.djangoproject.com/en/dev/topics/forms/#displaying-a-form-using-a-template For inserting javascript, why you have to 'extend'; us

Re: Doing a relationship lookup from within a model.

2011-10-20 Thread Venkatraman S
On Tue, Oct 18, 2011 at 8:22 PM, Jack Morgan wrote: > I've got 2 tables that are related to each other. Orders and History. > Inside the History table is the 'status' column. Like so.. > > class Orders(models.Model): > 'order info' > > class History(models.Model): > timestamp = models.DateTi

Re: sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-20 Thread Venkatraman S
On Thu, Oct 20, 2011 at 11:47 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > So, just out of curiosity, how many other people didn't realise you > could do this: > > >>> print '%(language)s has %(number)03d quote types.' % \ > ... {"language": "Python

Re: automatic models.py generation

2011-10-20 Thread Venkatraman S
On Fri, Oct 21, 2011 at 3:33 AM, Xangó3007 wrote: > I want to generate models.py file from a mysql database, (inverse > reengineering). Can you show me how to do it? Thanks. Xangó from Spain > > How complex is your schema, and what is the intent of doing this exercise? For some reason, i dont th

Re: default form template

2011-10-20 Thread Venkatraman S
On Fri, Oct 21, 2011 at 8:13 AM, bino oetomo wrote: > I'm learning (well ... reading) the jango template files. > Its Django :) (though we call it as 'django'(with 'd' being silent). > I'm looking for the default Form templates. > > If I want to just insert a simple javascript to all autogenera

Re: Django ORM - Am I trying to do the impossible?

2011-10-20 Thread Venkatraman S
On Fri, Oct 21, 2011 at 1:54 AM, Paolo wrote: > Any pointers would be appreciated - I'm not too excited about storing the > latest_assignment_update_id in my Assignment model!! > Why need to store this? If i understand the requirement right, the status of the Assignement is based on the last-a

default form template

2011-10-20 Thread bino oetomo
Dear All. I'm learning (well ... reading) the jango template files. I'm looking for the default Form templates. If I want to just insert a simple javascript to all autogenerated Form, what template file do I have to extend ? Sincerely -bino- -- You received this message because you are sub

Re: Radio button with nested widget

2011-10-20 Thread Kurtis Mullins
You could just create a form with two upload fields and a char field. And then use Javascript w/ Radio buttons to disable/enable those fields. On Thu, Oct 20, 2011 at 12:02 PM, Leonardo Giordani < giordani.leona...@gmail.com> wrote: > Hi all, > > I'm trying to implement the following form: a firs

Re: automatic models.py generation

2011-10-20 Thread Kurtis Mullins
I don't think it would be easily possible to do this with Django's ORM... but of course that depends on how your database is setup in the first place. Depending on your data-size, you might have better luck just building new Models and migrating your data. On Thu, Oct 20, 2011 at 8:51 PM, Sebastia

Re: automatic models.py generation

2011-10-20 Thread Sebastian Goll
On Thu, 20 Oct 2011 15:03:33 -0700 (PDT) Xangó3007 wrote: > I want to generate models.py file from a mysql database, (inverse > reengineering). Can you show me how to do it? Thanks. Xangó from Spain (django-admin/manage).py "inspectdb" [1] is your friend. Sebastian. [1] https://docs.djangopro

automatic models.py generation

2011-10-20 Thread Xangó3007
I want to generate models.py file from a mysql database, (inverse reengineering). Can you show me how to do it? Thanks. Xangó from Spain -- 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@googlegro

Re: Templates available to a cluster

2011-10-20 Thread Konstantinos Pachnis
Hello, I had the same problem, but not a clue how to implement this. After Donald mentioned that the template system uses pluggable loaders, I spent some time to create one for my own use. It's very basic, but at least I believe it demonstrates how to create a template loader. Kurtis, you can fin

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread Alasdair Nicol
Hi João and Torsten, On 20/10/11 18:53, João Pedro Francese wrote: I've just stumbled upon the same problem in my code. I have no clue on why it happened either. Did you ever get any progress on investigating this issue? Regards, Joao On Oct 7, 12:31 pm, Torsten Bronger wrote: Hall chen! I e

Django ORM - Am I trying to do the impossible?

2011-10-20 Thread Paolo
Hi all, I'm developing a Django app that has a slightly complex model, as follows: Teams have Assignments, which in turn have Assignment Updates. The status of the Assignment (and therefore the Team) is based on the latest Assignment Update, which has a status of ACTIVE, STANDBY etc. My issue

Re: Date and time picker in Django

2011-10-20 Thread Kurtis Mullins
ahh okay, haha sorry! On Thu, Oct 20, 2011 at 4:13 PM, Mario Gudelj wrote: > Yeah, that's the one i mentioned that doesn't work for me for some reason > > On 21/10/2011 7:10 AM, "Kurtis Mullins" wrote: > >> No problem. I honestly haven't had to use a time picker, yet. But a quick >> google searc

Re: Date and time picker in Django

2011-10-20 Thread Mario Gudelj
Yeah, that's the one i mentioned that doesn't work for me for some reason On 21/10/2011 7:10 AM, "Kurtis Mullins" wrote: > No problem. I honestly haven't had to use a time picker, yet. But a quick > google search brought this up: > http://trentrichardson.com/examples/timepicker/ It seems to work

Re: Date and time picker in Django

2011-10-20 Thread Kurtis Mullins
No problem. I honestly haven't had to use a time picker, yet. But a quick google search brought this up: http://trentrichardson.com/examples/timepicker/ It seems to work w/ the Jquery-ui Datepicker. On Thu, Oct 20, 2011 at 4:05 PM, Mario Gudelj wrote: > Thanks Kurtis. What do you use as a time pi

Re: Date and time picker in Django

2011-10-20 Thread Mario Gudelj
Thanks Kurtis. What do you use as a time picker? On 21/10/2011 6:39 AM, "Kurtis" wrote: > I just use Jquery-UI DatePicker http://jqueryui.com/demos/datepicker/ > > On Oct 20, 7:46 am, Mario Gudelj wrote: > > Hi guys, > > > > I'm looking for a date/time picker that I can use in my web forms. I'v

Re: Date and time picker in Django

2011-10-20 Thread Kurtis
I just use Jquery-UI DatePicker http://jqueryui.com/demos/datepicker/ On Oct 20, 7:46 am, Mario Gudelj wrote: > Hi guys, > > I'm looking for a date/time picker that I can use in my web forms. I've used > DateTimeField in my models and have to implement date in this format > "2011-10-19 21:34". I

Field.Choices in Template

2011-10-20 Thread Kurtis
Hey, I'm trying to build a custom template for my ModelForm. My ModelForm contains several M2M fields. If I run the ModelForm.as_view and then in my template print {{ form.as_p }} it'll automagically display those choices. Now what I want to do is take advantage of that magic and print out those

Re: sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-20 Thread Cal Leeming [Simplicity Media Ltd]
Damn right - too many times have my sprintf's ended up looking so ugly - it was borderline bad code. Goes to show, no matter how long you've used something, even if it's day in day out, there's always something new to learn! On Thu, Oct 20, 2011 at 7:52 PM, Bill Freeman wrote: > On Thu, Oct 20,

Re: sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-20 Thread Bill Freeman
On Thu, Oct 20, 2011 at 2:21 PM, Tim Chase wrote: > On 10/20/11 13:17, Cal Leeming [Simplicity Media Ltd] wrote: >> >> So, just out of curiosity, how many other people didn't realise you >> could do this: >> > print '%(language)s has %(number)03d quote types.' % \ >> >> ...       {"language":

Re: sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-20 Thread Tim Chase
On 10/20/11 13:17, Cal Leeming [Simplicity Media Ltd] wrote: So, just out of curiosity, how many other people didn't realise you could do this: print '%(language)s has %(number)03d quote types.' % \ ... {"language": "Python", "number": 2} Instead of this: print "%s has %03d" % ( "pyth

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread Torsten Bronger
Hallöchen! João Pedro Francese writes: > I've just stumbled upon the same problem in my code. I have no > clue on why it happened either. Did you ever get any progress on > investigating this issue? No, I have not investigated this further so far. (But I still know how to reproduce it.) At fir

sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-20 Thread Cal Leeming [Simplicity Media Ltd]
So, just out of curiosity, how many other people didn't realise you could do this: >>> print '%(language)s has %(number)03d quote types.' % \ ... {"language": "Python", "number": 2} Instead of this: print "%s has %03d" % ( "python", "2" ) 6 years of python development, and I never found

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread João Pedro Francese
I've just stumbled upon the same problem in my code. I have no clue on why it happened either. Did you ever get any progress on investigating this issue? Regards, Joao On Oct 7, 12:31 pm, Torsten Bronger wrote: > Hall chen! > > I examine a traceback that ends with > >     ... > >       File "/us

Re: load-on-startup equivalent in django?

2011-10-20 Thread Jacco Flenter
Another option is to create a command and run it via a cronjob On Thu, Oct 20, 2011 at 2:55 PM, kenneth gonsalves wrote: > > On Thu, 2011-10-20 at 13:38 +0800, Ken wrote: > > I wonder how do I do the same in django framework. Or there is some > > other way to run some background code periodicly?

Radio button with nested widget

2011-10-20 Thread Leonardo Giordani
Hi all, I'm trying to implement the following form: a first ChoiceField with values "mode 1", "mode 2" or "manual". Depending on its value I need to show a FileUpload field (mode1 or mode2) or some CharFields (mode3). I'm trying to mimic a desktop GUI, where you can three radio button and each c

Re: Doing a relationship lookup from within a model.

2011-10-20 Thread Bill Freeman
Don't you have an issue in that History is many to on on Orders, so an order has multiple states? Unless you're expunging History (in which case, isn't it mis-named?) or changing state in all of an Order's History instances (in which case don't you lose you audit trail), all Order's will have a Hi

Geodjango Tutorial: SRID problem when loading data from shapefile to PostGIS table

2011-10-20 Thread Pauline Emery
Dear all, I'm having a problem doing the section "LayerMapping" of the GeoDjango official Tutorial [1]. After creating load.py in the world directory. Leaving as specified: "the transform keyword set to False because the data in the shapefile does not need to be converted -- it's already in WGS84

Re: load-on-startup equivalent in django?

2011-10-20 Thread kenneth gonsalves
On Thu, 2011-10-20 at 13:38 +0800, Ken wrote: > I wonder how do I do the same in django framework. Or there is some > other way to run some background code periodicly? look at djcelery -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Dj

passing data between views / functions

2011-10-20 Thread John
Hello all, I'm building an interactive plotting routine. I have a question on how to manage data objects. I have a View (CBV inherited from DetailView and FormView) that uses information in the URL to parse out a few variables. From those variables I make a file system call to create a dictionary

load-on-startup equivalent in django?

2011-10-20 Thread Ken
Hello all I'm new to django and I have a question. I want to find a way to run some code periodicly in the background. Because I have a fax device which will put incoming call data in the database, I scan the database each 3 minutes for new incomings. In tomcat when I can make a servl

Re: .count() returning unexpected results

2011-10-20 Thread Tom Evans
On Thu, Oct 20, 2011 at 12:40 PM, Tim Chase wrote: > On 10/19/11 20:35, Tim Chase wrote: > > Perhaps I should have changed the test to be more clear, instead of using > >>   results = m.Person.objects.filter( >>       Q(name__iexact=alias) | >>       Q(aliases__alias__iexact=alias) >>       ) >>  

Date and time picker in Django

2011-10-20 Thread Mario Gudelj
Hi guys, I'm looking for a date/time picker that I can use in my web forms. I've used DateTimeField in my models and have to implement date in this format "2011-10-19 21:34". I have implemented http://trentrichardson.com/examples/timepicker/ o my site and it kind of works in a sense that the picke

Re: .count() returning unexpected results

2011-10-20 Thread Tim Chase
On 10/19/11 20:35, Tim Chase wrote: Perhaps I should have changed the test to be more clear, instead of using results = m.Person.objects.filter( Q(name__iexact=alias) | Q(aliases__alias__iexact=alias) ) self.assertEqual(1, results.count(), "Failed #%i on %r"

Re: Forms with FileField - access file content

2011-10-20 Thread Leonardo Giordani
Yes you are right, I was not thinking about security. :) Thanks 2011/10/20 Tom Evans > On Thu, Oct 20, 2011 at 10:49 AM, Leonardo Giordani > wrote: > > No, I think I didn't correctly explain the matter; say I have a Thing > model > > with a list of strings in it. > > > > I want the user to be

Re: Forms with FileField - access file content

2011-10-20 Thread Tom Evans
On Thu, Oct 20, 2011 at 10:49 AM, Leonardo Giordani wrote: > No, I think I didn't correctly explain the matter; say I have a Thing model > with a list of strings in it. > > I want the user to be able to: > > 1. Access the Thing creation form > 2. While editing the form loading a file and being pre

Django Atom feed Item Category

2011-10-20 Thread ggavy
Hi everyone, I'm geting a little confused with the 'item category' section of Django's atom feed framework. I want to extend each entry in a feed with a further piece of information beyond the standard title, id, etc. The only way I see how to do this is to make use of the 'category' element

Re: Android browser and csrf protection

2011-10-20 Thread Ivan Uemlianin
Dear All Just to follow up slightly: - iPhone and Blackberry browsers access the site properly; - the Android browser gets the csrf errors with django 1.2 and django 1.3 - with another site I'd developed earlier on django 1.2, the Android browser passes csrf verification properly. - the "failing"

Re: Forms with FileField - access file content

2011-10-20 Thread Leonardo Giordani
No, I think I didn't correctly explain the matter; say I have a Thing model with a list of strings in it. I want the user to be able to: 1. Access the Thing creation form 2. While editing the form loading a file and being presented with the full content 3. Choosing some lines from that content 4.

Re: Django admin multiple company accounts

2011-10-20 Thread zzart...@googlemail.com
Thanks for your time Mike, Cal, Andre! I had suspected that general consensus will be don't use admin :) still I had to ask. When i write down all the features admin has and features i will need to be created on top of admin somehow, i've come to the same conclusions. Still it hurts me a lot to b

Re: Forms with FileField - access file content

2011-10-20 Thread Venkatraman S
On Thu, Oct 20, 2011 at 1:32 PM, Leonardo Giordani < giordani.leona...@gmail.com> wrote: > > I'm trying to implement a an application where the user creates a new > object through a form. Up to here I'm fine. > > This time though the object creation involves loading a file and choosing > some data

Re: does php code works in Django

2011-10-20 Thread Sam Lai
On 20 October 2011 20:15, Chen Xu wrote: > Hi, everyone: > I am new to Django, does anyone know whether php code works in Django? This list's archives will have the answer to your question, and many variations of it. http://groups.google.com/group/django-users The short answer is no; PHP and Py

Re: does php code works in Django

2011-10-20 Thread @@
no On Thu, Oct 20, 2011 at 5:15 PM, Chen Xu wrote: > Hi, everyone: > I am new to Django, does anyone know whether php code works in Django? > > Thanks > > -- > ⚡ Chen Xu ⚡ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this

does php code works in Django

2011-10-20 Thread Chen Xu
Hi, everyone: I am new to Django, does anyone know whether php code works in Django? Thanks -- ⚡ Chen Xu ⚡ -- 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

Forms with FileField - access file content

2011-10-20 Thread Leonardo Giordani
Hi all, I'm trying to implement a an application where the user creates a new object through a form. Up to here I'm fine. This time though the object creation involves loading a file and choosing some data from it (say choosing some lines, for examples). So I'm a little stuck here. How can I let