prevent change depending on other field values

2012-09-13 Thread Mike Dewhirst
I want to lock a value in a ForeignKey field in a record once two other fields are non-blank. The record can be saved with changes to that ForeignKey field provided one of the other two fields is blank. Other fields in the record can be changed or the record deleted and reinserted but it

Re: Cant Import mysite.urls

2012-09-13 Thread Jon Blake
Hi Patrick, just got Apache + mod_wsgi to serve part 1 of the tutorial as per Django document "How to use Django with Apache and mod_wsgi". Your point taken about assuming things are going to be harder than they actually are - my redo of part 1 of the tutorial worked pretty well "out of the

Re: -bash: django-admin.py: command not found

2012-09-13 Thread Amyth Arora
Seems like your django-admin.py was not added to your system path, Try the following command sudo ln -s /usr/local/lib/python2.6/dist-packages/django/bin/django-admin.py /usr/local/bin/django-admin.py -- Thanks & Regards Amyth [Admin - Techstricks] Email -

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 2:53 PM, Russell Keith-Magee wrote: > On Fri, Sep 14, 2012 at 10:47 AM, Lachlan Musicman wrote: >>> How do I call reverse in the shell? Import it and...? >>> >>> reverse(s)? >> >> Gah, should have tried that before sending: >>

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Russell Keith-Magee
On Fri, Sep 14, 2012 at 10:47 AM, Lachlan Musicman wrote: >> How do I call reverse in the shell? Import it and...? >> >> reverse(s)? > > Gah, should have tried that before sending: > from django.core.urlresolvers import reverse reverse(s) > Traceback (most recent call

Re: Possible spam from mailing list? ("China Mobile")

2012-09-13 Thread Kurtis Mullins
I actually just received another one of those emails. The funny part is that it used this exact thread's subject in the message. I'm curious as to whether this 139.com is emailing everybody who sends an email to the list or if it only sends emails to people in who are involved in the same

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 2:47 PM, Lachlan Musicman wrote: >> How do I call reverse in the shell? Import it and...? >> >> reverse(s)? > > Gah, should have tried that before sending: > from django.core.urlresolvers import reverse reverse(s) > Traceback (most recent call

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
> How do I call reverse in the shell? Import it and...? > > reverse(s)? Gah, should have tried that before sending: >>> from django.core.urlresolvers import reverse >>> reverse(s) Traceback (most recent call last): File "", line 1, in File

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 2:05 PM, Lachlan Musicman wrote: > On Fri, Sep 14, 2012 at 1:38 PM, Russell Keith-Magee >> Something is going wrong in the reversing process, which is raising an >> exception, which is silently swallowed by the get_absolute_url call. >> The usual culprit

Re: Possible spam from mailing list? ("China Mobile")

2012-09-13 Thread Rivsen
13672725...@139.com , he has canceled his cell phone number, please administrator kick him. I use my phone call this number and be informed that the number no longer exists. 2012/9/13 Rivsen > I received this e-mail too. It's about someone using 139.com email join > the

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 1:38 PM, Russell Keith-Magee wrote: > On Fri, Sep 14, 2012 at 9:07 AM, Lachlan Musicman wrote: >> Hi, >> >> I'm getting blank get_absolute_url problems that I just can't solve. I >> can get to an object by actually visiting the

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Russell Keith-Magee
On Fri, Sep 14, 2012 at 9:07 AM, Lachlan Musicman wrote: > Hi, > > I'm getting blank get_absolute_url problems that I just can't solve. I > can get to an object by actually visiting the url that would be > constructed - I've checked that: app/session/year/month/day/slug … > And

get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
Hi, I'm getting blank get_absolute_url problems that I just can't solve. I can get to an object by actually visiting the url that would be constructed - I've checked that: app/session/year/month/day/slug models.py: class Session(models.Model): ... @models.permalink def

Re: New to Django, need help starting

2012-09-13 Thread Jono
Dear Kurtis, I'm brand new to Django and I have a bash and symlink issue I think with PATH. I cannot run django-admin.py. I want to take your advice and reinstall use Mac Brew etc. as you mention below. Would you mind elaborating on what you explain for an absolute n00b like myself? On

-bash: django-admin.py: command not found

2012-09-13 Thread Jono
I don't understand PATH and symlink and its relationship to trying to run django-admin.py for the first time. As you experienced users will see below I'm trying to create a new project and following the tutorial on djangoproject.com. Here is what my bash shows... Jonos-MacBook-Pro:djcode

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Russell Keith-Magee
On Thu, Sep 13, 2012 at 12:58 AM, Cal Leeming [Simplicity Media Ltd] wrote: > Hi all, > > There is a lot of debate on whether there is a real future for the Django > CBVs (class based views). Sigh. No - there isn't *any* debate about the future of CBVs.

Re: Problem Accessing Admin Pages

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 7:40 AM, bml1rules wrote: > Hey Guys! > > I am the webmaster of a Django database and I recently ran into a snag. We > have an admin section with about 15 privileges. All of a sudden, almost all > of them are gone. I've tried getting to them by

Problem Accessing Admin Pages

2012-09-13 Thread bml1rules
Hey Guys! I am the webmaster of a Django database and I recently ran into a snag. We have an admin section with about 15 privileges. All of a sudden, almost all of them are gone. I've tried getting to them by typing in the url, but it just takes me back to the main page. However, the pages are

Looking for Django Developer Position in Singapore

2012-09-13 Thread lakshmen45
Looking for a django-developer position in singapore. If interested, do contact me at lakshmen45 at gmail dot com. I will pass you my resume and details.. Thanks.. -- View this message in context: http://python.6.n6.nabble.com/Looking-for-Django-Developer-Position-in-Singapore-tp4988643.html

Re: testing a django package

2012-09-13 Thread Jonas Geiregat
Found the answer: I need to put from tests import * in the tests/__init__.py file > Actually, Django TestCases can override the URLConf, which allows you to have > a given URL for a given view in your test: > > from django.test import TestCase > > class MyTestCase(TestCase): > urls =

Re: testing a django package

2012-09-13 Thread Jonas Geiregat
Thanks you for your help. I understand now how I should setup testing for a django package. I'm using django-registration as an example , which works a similar way. I have a weird problem at hand. I'm creating a django package and would like to provide some test cases for it. The package is

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Thomas Lockhart
On 9/13/12 10:37 AM, Bob Aalsma wrote: Hmm, I'd seen this solution in http://keeyai.com/2012/02/17/django-deployment-create-superuser-fails-with-locale-error/ but was reluctant to use this as " I have no idea if this causes any negative side effects." A running system is not usually

Re: not picking up new template

2012-09-13 Thread Larry Martell
On Thu, Sep 13, 2012 at 12:51 PM, Dennis Lee Bieber wrote: > On Thu, 13 Sep 2012 10:52:44 -0600, Larry Martell > declaimed the following in > gmane.comp.python.django.user: > > >> So by stepping through a lot of code, I finally figured this out.

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Kurtis Mullins
Try installing python using "brew" or another packaging utility On Thu, Sep 13, 2012 at 1:54 PM, Bob Aalsma wrote: > Umm, could you be more specific about how/where to put this? > All the combinations and location I could think of will all still give the > same

Re: Basic auth struggle

2012-09-13 Thread Thomas Orozco
Could you us the line where you import login? On Sep 13, 2012 2:06 PM, "Timster" wrote: > What does the rest of your views.py file look like? > > Do you happen to have a view named login()? > > -- > You received this message because you are subscribed to the Google Groups

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Bob Aalsma
Umm, could you be more specific about how/where to put this? All the combinations and location I could think of will all still give the same error... Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het volgende: > > I'm a newbie following the tutorial. In this, creating a

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Bob Aalsma
Hmm, I'd seen this solution in http://keeyai.com/2012/02/17/django-deployment-create-superuser-fails-with-locale-error/ but was reluctant to use this as " I have no idea if this causes any negative side effects." So that is the official repair? OK. Thanks! Op donderdag 13 september 2012

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Tom Lockhart
On 2012-09-13, at 10:17 AM, Bob Aalsma wrote: > Django 1.4.1 > Python 2.7.3 > OS X 10.7.4 Ah, OS X… You need to (slightly) modify your manage.py file to add this near the top: import os os.environ.setdefault('LANG','en_CA') substituting your favorite language setting of course. hth

Re: Hung apache threads after upgrading to django 1.4

2012-09-13 Thread Dane
We have extended status on. Here is a link to our full status output. This does not occur consistently, but under high traffic we see an increasing amount of occurrences. I appreciate the help. http://pastebin.com/wP8Xfrwf On Wednesday, September 12, 2012 9:20:10 AM UTC-5, Tom Evans wrote:

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Bob Aalsma
Django 1.4.1 Python 2.7.3 OS X 10.7.4 Op donderdag 13 september 2012 19:12:30 UTC+2 schreef creecode het volgende: > > Which version of django are you using? > > On Thursday, September 13, 2012 7:58:11 AM UTC-7, Bob Aalsma wrote: > > I'm a newbie following the tutorial. In this, creating a

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread creecode
Which version of django are you using? On Thursday, September 13, 2012 7:58:11 AM UTC-7, Bob Aalsma wrote: I'm a newbie following the tutorial. In this, creating a superuser is > described, using > > manage.py createsuperuser --username=joe --email=j...@example.com > > > > Using this leads

Re: not picking up new template

2012-09-13 Thread Larry Martell
On Thu, Sep 13, 2012 at 7:11 AM, Larry Martell wrote: > On Wed, Sep 12, 2012 at 11:39 AM, Thomas Orozco wrote: >> Can you being up a manage.py shell and load the template from there to >> identify where's Django is pulling the template from? > > I'm

OR together multiple extra clauses

2012-09-13 Thread stratos moros
Hello, I am having some trouble using Queryset's extra method. I can't find a way to OR together multiple such clauses. Here's my case: I am using Django 1.4 on PostgreSQL 9.2 and I need to perform accent insensitive queries on some models. In Postgres, this is handled by the unaccent function.

How to add a ManyToManyField at runtime?

2012-09-13 Thread James Pic
Hello everybody, This is what I'm trying to do: def test_basic_addition(self): # create field f = models.ManyToManyField(to=X, related_name='bar') f.contribute_to_class(Y, 'x') # create table field = Y._meta.get_field_by_name('x')[0] through =

Re: Django and LDAP

2012-09-13 Thread Ivan Pavlović
Thank you sbrandt. I found the same thing, but i don't know how to use it. Where do i need to copy the files and do i erase some lines of the code or not, to make them as comments. I'm trying but i am not succeeding at making it work... Can you help me about that? On Thu, Sep 13, 2012 at 10:16

Re: Separating models from proxies conflicts

2012-09-13 Thread cs
Am Montag, 20. August 2012 15:52:28 UTC+2 schrieb Nacho Mas: > > I'm trying to separate my models from my proxies in order to maintain the > functionality more easily. The point is that, as my models.py started to > grow over and over, I decided to create a new file in each app (proxies.py) >

newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Bob Aalsma
I'm a newbie following the tutorial. In this, creating a superuser is described, using manage.py createsuperuser --username=joe --email=j...@example.com Using this leads to an error, which I could match to the closed ticket #16017. But I couldn't find how to proceed from there. It seems

Re: not picking up new template

2012-09-13 Thread Larry Martell
On Wed, Sep 12, 2012 at 2:21 PM, Thomas Orozco wrote: > Here's an example: > > from django.template import loader > l = > loader.find_template_loader('django.template.loaders.app_directories.Loader') > # Or W/E loader you happen to use >

Re: not picking up new template

2012-09-13 Thread Larry Martell
On Wed, Sep 12, 2012 at 11:39 AM, Thomas Orozco wrote: > Can you being up a manage.py shell and load the template from there to > identify where's Django is pulling the template from? I'm trying to do that, but I get: >>> t = Template('/path/to/template.html') >>> t.name '' I

Potential Bug with hidden_intial_fields

2012-09-13 Thread cs
Hello, while working on a mechanism for optimistic offline locking for django modelforms we discovered the following issue: After a failed form validation this forms hidden_initial-fields (rendered via the field argument show_hidden_initial=True) will be rendered containing the submitted

Re: Basic auth struggle

2012-09-13 Thread Timster
What does the rest of your views.py file look like? Do you happen to have a view named login()? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: tastypie - some feedback / comments

2012-09-13 Thread Jani Tiainen
13.9.2012 11:23, sbrandt kirjoitti: After evaluating some API creation frameworks, namely tastypie, pistion and django rest framework, it came out that I would never use the first two in my projects. Sorry that I can't provide more detailed information, but it's about a year ago. Both had

Re: Submitting data from a form

2012-09-13 Thread Tom Evans
On Thu, Sep 13, 2012 at 6:26 AM, KVR wrote: > Hi, > I am a Django learner . > I need to do a requirement as described below. > > 1.There is a column in a model > 2.I want to create a template with a select button in that. > 3.On selecting an option and submitting, the column

How to use admin Calendar widget in django application

2012-09-13 Thread Anwar Shaikh
Hello , I am trying to implement admin calendar widget in application. There is no media folder in my application I have googled a lot but ddnt find a way to add in my application can anybody help me -- You received this message because you are subscribed to the Google Groups "Django

Submitting data from a form

2012-09-13 Thread KVR
Hi, I am a Django learner . I need to do a requirement as described below. 1.There is a column in a model 2.I want to create a template with a select button in that. 3.On selecting an option and submitting, the column should be updated with the submitted value. Please give me some idea on how

Re: Unhelpful template traceback

2012-09-13 Thread David Barnett
For posterity, I think the link should have been https://code.djangoproject.com/ticket/11461. David On Monday, January 4, 2010 11:14:24 AM UTC-8, Margie Roginski wrote: > > > I had also noticed that errors from templates were quite hard to > debug. Some time ago I saw this thread on on this

Re: tree.io installation with django

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
I think this looks like an incompatible Django version to be honest, coupled with some other weird/wonderful problems. The invalid syntax thing is also a bit odd, as it looks valid to me. My advice would be to start again from scratch with the installation tutorial, and see if you can get any

Re: Syncdb is producing different databases on different machines.

2012-09-13 Thread Brian McKeever
I appreciate your help. Thank you. On Wednesday, September 12, 2012 11:28:44 AM UTC-6, Brian McKeever wrote: > > I actually figured it out. > > I created a new virtualenv on my development machine and installed the > requirements to it, and from that virtualenv, syncdb fails to install the >

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Dan Gentry
It would be helpful to see some more complex examples with these classes. One thing I like about the CBVs is that they include all of the necessary code for common functions. I have used them extensively (once I figured them out). On Wednesday, September 12, 2012 12:59:12 PM UTC-4, Cal

Re: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to informati

2012-09-13 Thread Coulson Thabo Kgathi
ok thanks let me try it now -- 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/-/TTB8Mc1WSQoJ. To post to this group, send email to

Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Sep 13, 2012 at 9:42 AM, Derek wrote: > Cal > > Great post; I think you summed up my feelings about django-reversion as > well, although articulated extremely clearly. > > If CuteModel (where does that name come from??) > Cute was the first word that came to my

Re: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to informati

2012-09-13 Thread Jani Tiainen
13.9.2012 11:04, Coulson Thabo Kgathi kirjoitti: how i plot a point atleast manually is what i cant find how to do. If atleast i could know how, which i think is done in the models.py then i would be good to go afterwards -- You received this message because you are subscribed to the Google

Re: Userena, how to set the avatar (mugshot) at signup time?

2012-09-13 Thread Bastian
Well it's easy, just follow the FAQ to add some extra fields and in the forms.py : from django import forms from userena.forms import SignupForm class SignupFormExtra(SignupForm): avatar = forms.ImageField() def save(self): new_user = super(SignupFormExtra, self).save()

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
Ah, thanks for letting me know - the original snippet by eallik had support for this, but I must have stripped it out not realising. On Thu, Sep 13, 2012 at 1:34 AM, Matt Schinckel wrote: > One really small nitpick: when returning a 405, it is a requirement that > you return

Re: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-13 Thread James Bennett
On Thu, Sep 13, 2012 at 4:25 AM, DJ-Tom wrote: > Basically I always try to have the same environment for development as I > also use for actual production - I'm lucky that my projects are small enough > so i can do that :-) to avoid last minute surprises when trying to

Re: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-13 Thread DJ-Tom
> Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had >> to restart Apache to make config changes effective... is that "normal"? >> >> I think important things like "you have to restart the webserver to make >> changes life" should go into the tutorial in *BIG RED

Basic auth struggle

2012-09-13 Thread pearlball
Struggling with my very basic django auth login system. When a new user registers, they are first redirected to `/user/user_id` as I'd like (the user is being created fine), but they are then redirected to `/login?next=/user/user_id/` which is being done by the @login_decorator over the `user`

Re: Changing the text on the admin "change_list.html"

2012-09-13 Thread Derek
I see I was not specific enough. I do not want to change the model name; just the wrapper text that is used for *all* models. Thanks Derek On Tuesday, 11 September 2012 19:41:07 UTC+2, Melvyn Sopacua wrote: > > That would be the verbose name in the models' meta class. I think > Op 8 sep. 2012

Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-13 Thread Derek
Cal Great post; I think you summed up my feelings about django-reversion as well, although articulated extremely clearly. If CuteModel (where does that name come from??) can address the issue of reverting a change to a record (or, even better, all changes made at one time to a record), then I

Re: tastypie - some feedback / comments

2012-09-13 Thread sbrandt
After evaluating some API creation frameworks, namely tastypie, pistion and django rest framework, it came out that I would never use the first two in my projects. Sorry that I can't provide more detailed information, but it's about a year ago. Both had issues with their architecture and

Re: Django and LDAP

2012-09-13 Thread sbrandt
Did you know there is django-auth-ldap which is a custom backend for authenticating users through LDAP? http://pypi.python.org/pypi/django-auth-ldap/ I don't see the point why you fiddle around with writing code on your own. I'm using django-auth-ldap since one and a half year in production

Re: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to informati

2012-09-13 Thread Coulson Thabo Kgathi
how i plot a point atleast manually is what i cant find how to do. If atleast i could know how, which i think is done in the models.py then i would be good to go afterwards -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this

Re: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to informati

2012-09-13 Thread Jani Tiainen
13.9.2012 10:51, Coulson Thabo Kgathi kirjoitti: What i did so far is create a GeoDjango project, the define models as shown below #models.py looks like thi from django.db import models # Create your models here. # This is an auto-generated Django model module created by ogrinspect. from

Re: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to informati

2012-09-13 Thread Coulson Thabo Kgathi
What i did so far is create a GeoDjango project, the define models as shown below #models.py looks like thi from django.db import models # Create your models here. # This is an auto-generated Django model module created by ogrinspect. from django.contrib.gis.db import models class

Re: Django Tutorial

2012-09-13 Thread maha
Tell us what the urls.py and settings.py. Have you uncomment the line django.admin.site in settings.py On Sunday, September 9, 2012 6:32:14 AM UTC+5:30, David Perez wrote: > > Hi, > > I am new to Django, I am actually starting its tutorial. On part 2 it > enables the admin site, but I can't log

Re: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to informati

2012-09-13 Thread Jani Tiainen
13.9.2012 10:29, Coulson Thabo Kgathi kirjoitti: Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to information where i can find how to do that. i have been

Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to information w

2012-09-13 Thread Coulson Thabo Kgathi
Can i be able to plot a points on maps with geodjango? i figured i can plot polygons on a map but struggling to plot points is it possible? if it is how do i do it or help with a link to information where i can find how to do that. i have been searching and cant find much infor about it. If i

Re: Model Validation with Exception Handling

2012-09-13 Thread Jani Tiainen
Hi, I'm using following piece of code with ExtJS: def extjs_validate_instance(instance): """Validate given Django model instance. Return ExtJS formatted error response. """ try: instance.full_clean() # Validate except ValidationError, e: opts =