Re: Getting into professional django development

2011-10-19 Thread kenneth gonsalves
On Wed, 2011-10-19 at 08:47 +0200, Paul Menzel wrote: > I thought that is what I wrote. Maybe I need to improve my English. > > > I think the sed command is correct. > > The to be replaced term goes first. > > $ echo "1.3" | sed s/1.2/1.3/ > 1.3 > $ echo "1.2" | sed s/1.2

Re: custom table for django authentication possible

2011-10-19 Thread Kurtis Mullins
Ahh okay. Yeah -- you'll most likely need to write your own custom authentication backend to use the existing table. https://docs.djangoproject.com/en/1.3/topics/auth/#writing-an-authentication-backend Good luck! On Wed, Oct 19, 2011 at 2:36 AM, Jisson Varghese < jisson.vargh...@dexetra.com> wro

Django Docs Suggestion - Color Code

2011-10-19 Thread Kurtis
Hey Guys, I know I saw in one of the threads where someone had asked how another person had missed the doc's version number. Just a suggestion on making these things a bit more obvious, you could color code them. It doesn't have to be on a per-version basis but maybe do something along the lines

Re: Facebook Authentication: Client side vs. Server side

2011-10-19 Thread Reikje
I would do it server side. Some people might have JavaScript disabled, so I wouldn't rely on the JavaScript SDK. Does django-social-auth support OAuth2 for Facebook? I can only see OAuth from the docs. On Oct 18, 5:18 pm, Vijay Khemlani wrote: > Hello, > > I'm just starting with a project that re

Re: Getting into professional django development

2011-10-19 Thread Tom Evans
On Wed, Oct 19, 2011 at 3:28 AM, kenneth gonsalves wrote: > On Tue, 2011-10-18 at 16:00 +0100, Tom Evans wrote: >> I can't stand incorrect pedantry - this is my curse. >> >> Kenneth actually said that "1.3 is ancient, you should be using >> trunk", which he corrected to "1.2 is ancient, you should

Django admin multiple company accounts

2011-10-19 Thread zzart...@googlemail.com
Hi Everyone I need to build one instance of django admin that can be used by multiple companies. the schema is : Company1 Branch 1 User 1 User 2 Branch 2 User 3 ... Company 2 Branch 1 User 4 User 5 Branch 2

RE: session expire

2011-10-19 Thread Peio Ziarsolo
Hi, I am still with the same problem. Most of the times django is a black box for me. I have never use a good tool to debug a django project. I thinsk that this is my bigest problem, without that I won't be able to solve this kind of problems. Could some one tell me which tool do you use to

Will template extends break the html structure?

2011-10-19 Thread Tony Guo
Hi,everyone.I have had a strange problem on my homework .I load "index.html" template,which extends "base.html" template,in views,then access it through firefox and firebug show that the markup seems to be broke.However,if loading "base.html" directly instead of "index.html" in views,it works righ

Re: Django admin multiple company accounts

2011-10-19 Thread Cal Leeming [Simplicity Media Ltd]
Yup - we created something similar for a client that had multi level branches - we used a single 'companies' table with a ForeignKey to itself, so that your table design can allow an (almost) unlimited amount of sub levels. To be honest, you're probably (not 100% sure) creating *more* work for you

custom widgets: passing data between widget/field/form/model

2011-10-19 Thread Aljoša Mohorović
i'm subclassing ForeignKey but can't figure out howto access actual instance (model data). if i'm doing "class MyField(ForeignKey)", what do i need to override, which MyField method, where i have access to related instance data (or None if it doesn't exists)? digging through the code i've found "s

Re: custom widgets: passing data between widget/field/form/model

2011-10-19 Thread Tom Evans
On Wed, Oct 19, 2011 at 12:05 PM, Aljoša Mohorović wrote: > i'm subclassing ForeignKey but can't figure out howto access actual > instance (model data). > if i'm doing "class MyField(ForeignKey)", what do i need to override, > which MyField method, where i have access to related instance data (or

Re: custom widgets: passing data between widget/field/form/model

2011-10-19 Thread Aljoša Mohorović
On Wed, Oct 19, 2011 at 1:21 PM, Tom Evans wrote: > I suggest you rethink your approach. Subclassing ForeignKey so that > you can build a better widget does not seem sane. Why do you think > this would help? because the simplest way to make it reusable is to have "from myapp.fields MyCustomField"

Re: Getting into professional django development

2011-10-19 Thread Benedict Verheyen
On 18/10/2011 8:45, Kevin wrote: > Hello everyone! > > I have been using Django for about a year now and feel that I want > to take my experience to the next level. I have created a few website > using Django to test my skills, although not for anyone specific. I > am creating this thread as I

Admin Home Apps and Models ordering

2011-10-19 Thread Pedro Vasconcelos
Hello, I'm wondering how can I do personal Apps and Models ordering on Django Admin Home page. Thanks in advanced, -- Pedro Vasconcelos 85 8767.1843 ptronico (skype) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Android browser and csrf protection

2011-10-19 Thread Ivan Uemlianin
Dear All I have a django webapp with a very simple login page, a form with username, password and the {% csrf %} tag. The page works as expected when using Chrome, Firefox and Safari, but when trying to login from my Android phone browser, the page returns the "CRSF verification failed" error pag

Error handeling with Try

2011-10-19 Thread Guy Nesher
I have an odd problem tracking errors in a for loop I assign a loop counter to each error and print them at the end of the loop, but all the errors are numbered to the last iteration. The code goes something like this : error = [0,[]] counter = 0 for row in reader: counter +=1 try: #

Re: Error handeling with Try

2011-10-19 Thread J. Cliff Dyer
On 10/19/2011 10:49 AM, Guy Nesher wrote: I have an odd problem tracking errors in a for loop I assign a loop counter to each error and print them at the end of the loop, but all the errors are numbered to the last iteration. The code goes something like this : error = [0,[]] counter = 0

direct query to Oracle db view doesn't work

2011-10-19 Thread msbuck
I'm having another strange problem. I'm executing SQL statements directly rather than using the ORM and it is working fine except when I query one particular view. Then the query returns nothing. I can execute the same query from python by using the cx_Oracle module directly and it returns what I e

Re: Django admin multiple company accounts

2011-10-19 Thread Andre Terra
Hi Mars, On Wed, Oct 19, 2011 at 8:55 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > (...) > > To be honest, you're probably (not 100% sure) creating *more* work for > yourself trying to make something like this work in django admin, than just > designing

manage.py --settings breaks IPython

2011-10-19 Thread h3
I like to use IPython for debugging when developping, but it breaks if I use the --settings argument.. So if I do this: $: python manage.py runserver --settings=settings_dev The server will run, but when IPShellEmbed is invoked I get this error: > Error in Arguments: "Illegal option '--settings

Re: Django Docs Suggestion - Color Code

2011-10-19 Thread Andre Terra
Agreed. I had the same idea but was a little lazy at the time to write an e-mail. I say old versions (pre 1.3, atm) should be grayed out, trunk should be reddish (or orange to match the canonical palette). Cheers, AT On Wed, Oct 19, 2011 at 5:33 AM, Kurtis wrote: > Hey Guys, > > I know I saw

Re: Error handeling with Try

2011-10-19 Thread Guy Nesher
Thanks On Oct 19, 3:57 pm, "J. Cliff Dyer" wrote: > On 10/19/2011 10:49 AM, Guy Nesher wrote: > > > > > > > > > > > I have an odd problem tracking errors in a for loop > > I assign a loop counter to each error and print them at the end of the > > loop, but all the errors are numbered to the last

Re: manage.py --settings breaks IPython

2011-10-19 Thread James Pyrich
It might be attempting to interpret --settings as a Python option. Try the following: $: python manage.py runserver -- --settings=settings_dev Any Python-specific settings go before the double-dash, etc., etc. On 10/19/2011 12:11 PM, h3 wrote: I like to use IPython for debugging when develo

Re: manage.py --settings breaks IPython

2011-10-19 Thread h3
Doesn't work.. > Error: Usage is runserver [optional port number, or ipaddr:port] And if I do the opposite: $: python manage.py runserver --settings=settings_dev -- Same problem comes back. On Oct 19, 12:52 pm, James Pyrich wrote: > It might be attempting to interpret --settings as a Python o

Re: Django admin multiple company accounts

2011-10-19 Thread Mike Seidle
On Wednesday, October 19, 2011 02:10:49 PM Andre Terra wrote this and sent it to To: django-users@googlegroups.com:: > > To be honest, you're probably (not 100% sure) creating *more* work for > > yourself trying to make something like this work in django admin, than > > just designing something

Re: manage.py --settings breaks IPython

2011-10-19 Thread James Pyrich
Try executing $: python --help or $: python -h To see what it says about passing arguments to your script. I don't have any other suggestions for you, unfortunately. Good luck. On 10/19/2011 12:56 PM, h3 wrote: Doesn't work.. Error: Usage is runserver [optional port number, or ipaddr

Re: manage.py --settings breaks IPython

2011-10-19 Thread J. Cliff Dyer
On 10/19/2011 12:56 PM, h3 wrote: Doesn't work.. Error: Usage is runserver [optional port number, or ipaddr:port] And if I do the opposite: $: python manage.py runserver --settings=settings_dev -- Same problem comes back. On Oct 19, 12:52 pm, James Pyrich wrote: It might be attempting to

In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Timmy O'Mahony
I am trying to use a 3rd party form field and custom widget in my own model form and I am having trouble understanding what the "rel" attribute is used for. for example: class SomeFormField(forms.ModelChoiceField): def __init__(self, rel, queryset, to_field_name, *args, **kwargs): ... I see it

Re: In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Andre Terra
Hello, Timmy "rel" is the related manager object that will be used in specific fields, namely those that refer to relationships to other table. These relationships are handled by objects in django.db.models.fields.related[1]. For example, take User and Group from django.contrib.auth.models. Assum

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread dmitry b
see if a pamaterized query works: cursor.execute('SELECT account_number FROM vw_billed_summary_fact WHERE ippa=%s', ['col11-emnj00-1147']) d. On Oct 19, 8:25 am, msbuck wrote: > I'm having another strange problem. I'm executing SQL statements > directly rather than using the ORM and it is wor

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread msbuck
I just tried it and it doesn't. If I try an aggregate query such as using COUNT(account_number) without the Where clause, I get a row with 0 in it (there are thousands of account_numbers). Thanks for the suggestion. On Oct 19, 1:30 pm, dmitry b wrote: > see if a pamaterized query works: > >  c

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread dmitry b
I'm starting to doubt this is a Django issue. Double check that you are connecting to the database/schema you *think* you are connecting to and you are using the use account you *think* you are using :) D. On Oct 19, 11:46 am, msbuck wrote: > I just tried it and it doesn't. If I try an aggregat

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread msbuck
I'm not sure how to check this. There are many other tables and views in the database which I have no trouble retrieving data from. I can use SQL Developer to execute the query on the view using the same username, password, and database name. When I used cx_Oracle directly, I am creating the connec

Templates available to a cluster

2011-10-19 Thread Kurtis
I'm working on a project where I will eventually need to be able to add/delete/manage templates on the fly. Our Django Application Servers are setup as a cluster behind an Nginx Front-end Server. We're not at that point, yet -- but I wanted to see if there's any architectural issues I need to prep

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
The template system uses pluggable loaders that can locate a template based upon it's name. So using that you can store your template anywhere. There is already an app for storing templates in the db, you could easily make one to store it somewhere else as well. On Wednesday, October 19, 2011

Re: Templates available to a cluster

2011-10-19 Thread Kurtis Mullins
Very true, I could definitely implement it as a pluggable loader. I'll try to find the DB Template Loader too. I'm mainly concerned with this being a large bottle neck for our front-facing pages so I'm not sure which path to choose. Maybe some R&D is in order :) Thanks! On Wed, Oct 19, 2011 at 5:5

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
If I wanted maximum performance from a distributed on the fly template system. I'd probably store them in a fast document db. On Wednesday, October 19, 2011 at 5:54 PM, Kurtis Mullins wrote: > Very true, I could definitely implement it as a pluggable loader. I'll try to > find the DB Template L

Re: Templates available to a cluster

2011-10-19 Thread Kurtis Mullins
Good idea. I'm going to check out MongoDB for this. Looks like there's already some Django tools for it out there. On Wed, Oct 19, 2011 at 5:57 PM, Donald Stufft wrote: > If I wanted maximum performance from a distributed on the fly template > system. I'd probably store them in a fast document db

Re: Templates available to a cluster

2011-10-19 Thread Javier Guerra Giraldez
On Wed, Oct 19, 2011 at 5:17 PM, Kurtis Mullins wrote: > Good idea. I'm going to check out MongoDB for this. Looks like there's > already some Django tools for it out there. > > On Wed, Oct 19, 2011 at 5:57 PM, Donald Stufft > wrote: >> >> If I wanted maximum performance from a distributed on the

Re: Django Docs Suggestion - Color Code

2011-10-19 Thread Cal Leeming [Simplicity Media Ltd]
+1 On Wed, Oct 19, 2011 at 5:07 PM, Andre Terra wrote: > Agreed. I had the same idea but was a little lazy at the time to write an > e-mail. > > I say old versions (pre 1.3, atm) should be grayed out, trunk should be > reddish (or orange to match the canonical palette). > > > Cheers, > AT > > >

Re: In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Timmy O'Mahony
Wow, thanks for the great reply. It makes sense that it's the related object manager. I have everything working now so thank you very much again! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://

.count() returning unexpected results

2011-10-19 Thread Tim Chase
Querying for .count() on a result (len(results) will also trigger the issue) that pulls in a FK table throws off the count. Sample code, tests and results below: foo/models.py = from django.db import models class Person(models.Model): name = models.CharField(max_length=42)

RE: session expire

2011-10-19 Thread kenneth gonsalves
On Wed, 2011-10-19 at 08:52 +0200, Peio Ziarsolo wrote: > Could some one tell me which tool do you use to debug with django. > Thanks in advance print statements. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Getting into professional django development

2011-10-19 Thread kenneth gonsalves
On Wed, 2011-10-19 at 09:57 +0100, Tom Evans wrote: > 1) Docs are updated as code is updated. If your checked out trunk is > older than that used to generate the docs, then you are trying to > learn by reading documentation that is incorrect for your code. > 2) If you counteract this by religiously

Re: Getting into professional django development

2011-10-19 Thread kenneth gonsalves
On Wed, 2011-10-19 at 14:59 +0200, Benedict Verheyen wrote: > - Debian ( 1st install was potato :)) > - VirtualBox > - nginx > - gunicorn > - supervisord (watch gunicorn process) > - git > - virtualenv > - pip (coupled with virtualenv, it's a powerful tool) > - south (easy db migration) > - fabric

Re: .count() returning unexpected results

2011-10-19 Thread Javier Guerra Giraldez
On Wed, Oct 19, 2011 at 8:35 PM, Tim Chase wrote: > I understand what it's doing at a SQL level, but not sure if this is a > "correct" behavior for .count() or the resulting list of objects. > > Any thoughts/suggestions? usually adding .distinct() to the queryset makes it less surprising -- Jav

Re: Will template extends break the html structure?

2011-10-19 Thread Tony Guo
It's OK now.The source code is right,but,for using some Chinese character,i have to change the source file from GB2312 to UTF-8(in win7) during which something go wrong and caused such a error.I am using Ubuntu now and everything goes right. -- You received this message because you are subscribed

Re: .count() returning unexpected results

2011-10-19 Thread Venkatraman S
Try using DDT to see the the query being fired and walk your way up. -V http://about.me/venkasub -- 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,

Re: Django Docs Suggestion - Color Code

2011-10-19 Thread Venkatraman S
A ribbon at the top would be helpful too. I am used to checking the URL generally to avoid cross-version-surprises. -V http://about.me/venkasub -- 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@go

Re: ModelClass Form Help

2011-10-19 Thread Venkatraman S
On Tue, Oct 18, 2011 at 9:22 PM, Vishnu vg wrote: > Hi Friends, > > Iam a beginner in django. I am developoing a contact form page. I created a > modelclass called 'contacts' and then created a a modelFormClass from that > model. I have two comboboxes in form called 'state' and 'city'. While > se