Re: Newbie django/python with C++ background wants enums

2012-02-01 Thread Mike Dewhirst
On 2/02/2012 12:13pm, Nikolas Stevenson-Molnar wrote: TO_USE= ( ('Y', 'Yes'), ('N', 'No'), ) class X(models.Model): txt= models.CharField(db_index=True,null=True, blank=True,max_length=30) use_txt= models.CharField(blank=False,max_length=1,default='D',choices=TO_USE)

Django version changed

2012-02-01 Thread lu uky
You can update the argument maxlength to max_length. -- 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

Re: Newbie django/python with C++ background wants enums

2012-02-01 Thread Chris
A different way would be to define constants: YES = 'Y' NO = 'N' TO_USE= ( (YES, 'Yes'), (NO, 'No'), ) --- from myapp.models import YES class XForm(forms.ModelForm): def clean(self): cleaned_data=super(XForm, self).clean() txt= cleaned_data['txt'].strip()

Re: Apache Segfaults

2012-02-01 Thread akaariai
On Feb 2, 4:21 am, Alex Kopp wrote: > Yes, the development server works fine on the server I am getting the > apache error. The server is ubuntu and everything is installed either via > apt-get or pip. I'm not copying any modules from machine to machine. This is out of my

Re: Apache Segfaults

2012-02-01 Thread Alex Kopp
Yes, the development server works fine on the server I am getting the apache error. The server is ubuntu and everything is installed either via apt-get or pip. I'm not copying any modules from machine to machine. On Wed, Feb 1, 2012 at 9:13 PM, akaariai wrote: > On Feb 2,

Re: Apache Segfaults

2012-02-01 Thread akaariai
On Feb 2, 3:47 am, Loafer wrote: > Here's the setup: > > I have a Django website that is being run by Apache, and MySQL with no > issues. I decided to implement some GIS features as an update. Since > MySQL doesn't have much support for GIS, I decided to switch my > database

Apache Segfaults

2012-02-01 Thread Loafer
Here's the setup: I have a Django website that is being run by Apache, and MySQL with no issues. I decided to implement some GIS features as an update. Since MySQL doesn't have much support for GIS, I decided to switch my database over to Postgres. After committing the changes to my SVN, and

Re: Newbie django/python with C++ background wants enums

2012-02-01 Thread Jeff Heard
*slightly* better would be: class X(models.Model): YES='Y' NO='N' DEFAULT='D' TO_USE = ((X.YES, "Yes"), (X.NO, "No"), (X.DEFAULT, "Default")) txt= models.CharField(db_index=True,null=True, blank=True,max_length=30) use_txt=

Re: Newbie django/python with C++ background wants enums

2012-02-01 Thread Nikolas Stevenson-Molnar
You could use a class, such as: class TO_USE: Y = 'Yes' N = 'No' if char == TO_USE.Y: pass _Nik On 2/1/2012 1:45 PM, NENAD CIKIC wrote: Hello, the subject expresses my discomfort with certain python characteristics, given my background, and my lack of python knowledge.

Newbie django/python with C++ background wants enums

2012-02-01 Thread NENAD CIKIC
Hello, the subject expresses my discomfort with certain python characteristics, given my background, and my lack of python knowledge. Specifically lets say that I have a model with a Text field and char field. The char field is length 1 and says "use or do not use the text field". The char

Re: Building authentication backend

2012-02-01 Thread Lee Hinde
On Feb 1, 2012, at 12:24 AM, apalsson wrote: > Hello. > > A very simple question. > > I am building an authentication back end to support TWO passwords. > This requires me to add an extra table to store the secondary password > plus a ForeignKey to User. > > The confusing part is, how I make

django-compressor throwing a 500 when DEBUG = False

2012-02-01 Thread CLIFFORD ILKAY
Hello, We're working on a Django 1.3 site on which we're using django-compressor . When DEBUG = True, everything works as expected. When DEBUG = False, django-compressor throws a 500 claiming that it can't find the unified CSS file that it just

Re: Building authentication backend

2012-02-01 Thread Mario Gudelj
I'm new to Django too, but I suspect you'd do something like this: class AdditinoalUserInfo(models.Model): user = models.ForeignKey(User, unique=True) extra_password = models.CharField("Password", blank=True) That will create a new table for you and a column for new password. You then

Re: admin list_filter: limit choices to model values?

2012-02-01 Thread Micky Hulse
Related to my original question: On top of needing to limit list_filter in the admin, I also needed to limit the user choices in my FK to auth.user. This bit of code does just that: Just thought I would share the code to help others. I am wondering if I can

Problem sending an email in html with mime image

2012-02-01 Thread Ariel
Hi everybody I have a question, here is my problem I want to send an email with content in html with an image embed so I converted the image binary in mime text and then I put the mime code inside the src attribute of the html like this: Then I send the email, here is my code: from

Re: Turbogears to Dajngo

2012-02-01 Thread Ovnicraft
On Wed, Feb 1, 2012 at 2:34 PM, sajuptpm wrote: > HI, > > I have a project developed in turbogears, i want to move it to > Django, is it possible ??? > I am using following feature of TG2 > controller > sqlalchemy > tg2env > developement.ini > Not using any template system,

Turbogears to Dajngo

2012-02-01 Thread sajuptpm
HI, I have a project developed in turbogears, i want to move it to Django, is it possible ??? I am using following feature of TG2 controller sqlalchemy tg2env developement.ini Not using any template system, since UI developed using EXTJS Reason to this change is, Pylons stopped further support

Startup Chile Company Looking For Founding Developer/CTO

2012-02-01 Thread Jennifer Turliuk
Hi everyone, My name is Jennifer Turliuk. I'm currently in Santiago, Chile for the next 6 months as part of the Startup Chile program. I think you may be able to help me out. We are looking to bring on a developer ASAP (see description below). If you are interested, we'd love to hear from you.

Re: what is the best IDE to use for Python / Django

2012-02-01 Thread Moises Alberto Lindo Gutarra
Aptana 3 2012/2/1 Bastian Ballmann : > And what exact feature makes PyCharm an IDE that emacs hasnt? > SCNR ;) > > Am 23.01.2012 13:41, schrieb Leandro Ostera Villalva: > > That's because PyCharm is an actual IDE while gedit, st2, emacs, vi and > forth are

Re: Using another database while testing

2012-02-01 Thread Denis Darii
You can redefine your database connection by adding somewhere at the end of your settings.py something like: import sys if 'test' in sys.argv: DATABASES = ... hope this helps. On Wed, Feb 1, 2012 at 6:01 PM, xina towner wrote: > I have a problem, django can't create

Which conferences for promoting a new FLOSS nanotech project?

2012-02-01 Thread Torsten Bronger
Hallöchen! We have implemented a samples database in our nanotech research institute using Django. I did most of it, and we have a full time employee working on it for three years. So far, it's 60.000 LOC. I plan to make in open source, and I'm optimistic that the director of the institute

Re: template error in html forms

2012-02-01 Thread Joel Goldstick
On Wed, Feb 1, 2012 at 10:00 AM, yati sagade wrote: > I've never run in to a TemplateError for anything other than what I > pointed out - maybe in the settings module it is ".../templates" and the > name of the directory is "template" (note the 's' in the end) or the other

Re: Django Admin completely empty

2012-02-01 Thread darwin_tech
All db tables are in place and the settings hold the correct login info. I can interact with all models in the shell and my applications run without problem (i.e. return data from the db). Sam On Feb 1, 11:17 am, Joel Goldstick wrote: > On Wed, Feb 1, 2012 at 12:11 PM,

django-mptt compared w/ django-treebeard

2012-02-01 Thread Aljosa Mohorovic
when using django-mptt or django-treebeard did anybody have bad experience? i've used treebeard before w/o problems but it looks like mptt is maintained and has newer releases and treebeard last release was in 2010. can anybody comment on possible future development/maintenance for these

Re: Django Admin completely empty

2012-02-01 Thread Joel Goldstick
On Wed, Feb 1, 2012 at 12:11 PM, darwin_tech wrote: > The source is also empty: > >         >         >         > >         >         > > as though it is aware there should be model information but is not > receiving any > > Any more suggestions? This is really

Re: Django Admin completely empty

2012-02-01 Thread darwin_tech
The source is also empty: as though it is aware there should be model information but is not receiving any Any more suggestions? This is really perplexing me. Sam On Jan 31, 2:42 pm, Joel Goldstick wrote: > On Jan

Using another database while testing

2012-02-01 Thread xina towner
I have a problem, django can't create my database because a dependency, I create it manually with a script, is there any way I can specify to the testing tool to use my database?thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: what is the best IDE to use for Python / Django

2012-02-01 Thread Masklinn
On 2012-02-01, at 17:00 , Bastian Ballmann wrote: > And what exact feature makes PyCharm an IDE that emacs hasnt? * Semantics navigation (not via tags, it knows to find a class when you want a class) * Better static analysis and language knowledge (the type inference is still pretty limited,

Re: what is the best IDE to use for Python / Django

2012-02-01 Thread Bastian Ballmann
And what exact feature makes PyCharm an IDE that emacs hasnt? SCNR ;) Am 23.01.2012 13:41, schrieb Leandro Ostera Villalva: That's because PyCharm is an actual IDE while gedit, st2, emacs, vi and forth are text editors. El 23 de enero de 2012 04:35, Mario Gudelj

Re: How to get unique results from fields in sliced QuerySet ?

2012-02-01 Thread bash look
Thanks for share , Anssi. I think the same way. Hope another solution rather than sliced, like LIMIT options on QuerySet in the future. Using raw SQL can not be avoided at this cases. Thanks anyway Bash On 02/01/2012 09:14 PM, akaariai wrote: On Feb 1, 10:24 am, bash

Re: template error in html forms

2012-02-01 Thread yati sagade
I've never run in to a TemplateError for anything other than what I pointed out - maybe in the settings module it is ".../templates" and the name of the directory is "template" (note the 's' in the end) or the other way round. Anyway, check for any misspelling in the template name itself - or

Re: template error in html forms

2012-02-01 Thread TANYA
yes, the path is already there. Maybe the problem is either in views.py or url.py file if changed it gives different error, but i dont know what to look for in those two files. On Wed, Feb 1, 2012 at 2:40 PM, yati sagade wrote: > in settings.py, in the TEMPLATE_DIRS

Re: template error in html forms

2012-02-01 Thread yati sagade
in settings.py, in the TEMPLATE_DIRS setting, add the absolute path to your templates directory - something like "/path/to/project/dir/template". This MUST be an absolute path. And if your modifying this setting for the first time, be sure to leave a comma (,) in the end of that path (Sorry if you

Re: template error in html forms

2012-02-01 Thread TANYA
the installed apps has 'mysite.books', in the path and the html files are in a directory under mysite project directory. Is that correct? On Wed, Feb 1, 2012 at 12:06 PM, Ankit Rai wrote: > Please check your template path in settings.py. > > > > > On Wed, Feb 1, 2012

Re: ANN: OGC Web Feature Service for GeoDjango

2012-02-01 Thread Jeff Heard
Great. There's more coming down the pipe. WFS was the first thing I had reasonably finished... On Tue, Jan 31, 2012 at 10:16 AM, George Silva wrote: > Wow! Congratulations on this release. > > I'm looking at it right now. > > :D > > On Tue, Jan 31, 2012 at 1:11 PM,

Re: Using Context Processor as form with HttpResponseRedirect

2012-02-01 Thread Jenna Pullen
Hi Daniel thanks for your reply that makes much more sense now. On Wednesday, February 1, 2012, richard wrote: > Hi i have seen alot of people saying to use a context processor to > include forms in multiple page. I have written a context processor > login form that

Re: Help Me With omab/django-socialauth

2012-02-01 Thread Thorsten Sanders
Some sort of error traceback/description would be helpful, from a quick look it seems all right. On 01.02.2012 13:23, coded kid wrote: Hey guys, I'm facing a huge problem with omab/django/socialauth. After setting all the necessary settings, I clicked on the “Enter using Twitter” link on my

Re: ManyRelatedManager reference

2012-02-01 Thread akaariai
On Feb 1, 2:02 pm, "Demetrio Girardi" wrote: > I can't find a reference for ManyRelatedManager in the django docs. I have > a few questions that you can ignore if there is in fact a reference somewhere > and you can point me to it. > > If my model is > > class

Re: How to get unique results from fields in sliced QuerySet ?

2012-02-01 Thread akaariai
On Feb 1, 10:24 am, bash look wrote: > Hi all, > > I have models called Books. > > To get unique results from Books, usually I use order_by().values('field'). > For example, I want unique writter : > >

Django admin set column width in change list

2012-02-01 Thread SvilenMinkov
Hello , Newbie question here : I need to change the column width in django- admin change list. Can I do it in admin.ModelAdmin or models.Model. Thanks, Svilen. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Building authentication backend

2012-02-01 Thread apalsson
Hello. A very simple question. I am building an authentication back end to support TWO passwords. This requires me to add an extra table to store the secondary password plus a ForeignKey to User. The confusing part is, how I make Django automatically create the needed table when SyncDB is run?

How to get unique results from fields in sliced QuerySet ?

2012-02-01 Thread bash look
Hi all, I have models called Books. To get unique results from Books, usually I use order_by().values('field'). For example, I want unique writter : Books.objects.filter(created__year=2012).order_by('writter').values('writter').distinct() But, how to get unique results from sliced Queryset ?

Re: Error making fixtures

2012-02-01 Thread akaariai
On Feb 1, 12:26 pm, xina towner wrote: > Hello, I'm tryng to do fixtures with dumpdata. I write this command: > > python manage.py dumpdata quests --indent=4 > > quests/fixtures/quests_views_testdata.json > > But I get this error message: > >

Help Me With omab/django-socialauth

2012-02-01 Thread coded kid
Hey guys, I'm facing a huge problem with omab/django/socialauth. After setting all the necessary settings, I clicked on the “Enter using Twitter” link on my homepage, it couldn’t redirect me to where I will enter my twitter username and password. Below are my settings. In settings.py

ManyRelatedManager reference

2012-02-01 Thread Demetrio Girardi
I can't find a reference for ManyRelatedManager in the django docs. I have a few questions that you can ignore if there is in fact a reference somewhere and you can point me to it. If my model is class Model(models.Model): many = models.ManyToManyField(OtherModel) what does this do?

template error in html forms

2012-02-01 Thread TANYA
In views.py, when I add this code gives template error. def search(request): error = False if 'q' in request.GET: q = request.GET['q'] if not q: error = True else: books = Book.objects.filter(title__icontains=q) return

Re: Using Context Processor as form with HttpResponseRedirect

2012-02-01 Thread Daniel Roseman
On Wednesday, 1 February 2012 01:34:03 UTC, richard wrote: > > Hi i have seen alot of people saying to use a context processor to > include forms in multiple page. I have written a context processor > login form that just returns the django Authentication form and > everything works great

Re: Django Model Errors : TypeError: 'class Meta' got invalid attribute(s): using

2012-02-01 Thread Daniel Roseman
On Tuesday, 31 January 2012 19:22:27 UTC, Subhodip Biswas wrote: > > Hi all, > I am newbie in django and while trying to write a database router for > using multiple database I did something like : > > class Meta: > using = 'somedatabasename' > > in Django models.py. > > However

Error making fixtures

2012-02-01 Thread xina towner
Hello, I'm tryng to do fixtures with dumpdata. I write this command: python manage.py dumpdata quests --indent=4 > quests/fixtures/quests_views_testdata.json But I get this error message: _mysql_exceptions.OperationalError: (1054, "Unknown column 'quests_quest.availability' in 'field list'")

Re: about QuerySet

2012-02-01 Thread Daniel Roseman
On Wednesday, 1 February 2012 08:34:14 UTC, akaariai wrote: > > On Feb 1, 9:36 am, newme wrote: > > do you mean that queryset will query database every time i call > > user[0]? > > Yes. That is exactly what happens: > In [7]: qs[0] > Out[7]: > In [9]: print

Re: about QuerySet

2012-02-01 Thread akaariai
On Feb 1, 9:36 am, newme wrote: > do you mean that queryset will query database every time i call > user[0]? Yes. That is exactly what happens: In [7]: qs[0] Out[7]: In [9]: print connection.queries [{'time': '0.011', 'sql': 'SELECT ... FROM "organisaatio_osa" LIMIT 1'}]

Re: Dynamic runtime modeling: which is the best choice?

2012-02-01 Thread Alessandro Candini
>         This sounds more like a need for shapefile translators (codecs, if > you will)... On input you'd convert the contents into a common database > format; reverse the process on output. What is a "common database format"? If a shape file has 5 fields and another one 10 (and I dont' know the

Inherited manytomany field not showing up in django shell

2012-02-01 Thread Kabir Kukreti
I am working on blog application. I have made class "GenericBlog", which I am inheriting to a class Blog.There is a manytomany field in the GenericBlog class called "sites". The problem in this that when I try to create an object of "Blog", in the django shell, it gives an error "sites si an