Re: Fixture Funny : 1st Row Of Each Table Missing

2012-01-25 Thread Johan
Ok. So I fixed the problem by starting my PK values at 1. It seems like there is a discrepancy between the way fixtures are imported into a mysql db and a sqlite db. Using PK's that start at 1 works on both. On Jan 25, 11:18 am, Johan wrote: > Hi. I'm having a funny issue.

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread kenneth gonsalves
On Wed, 2012-01-25 at 09:41 -0800, JJ Zolper wrote: > Okay I am glad to hear that something I knew was on the right track! > Thanks Kenneth! However what is OSM? Open Street Maps? maybe you could > tell me a little bit more about it as I have not heard of it http://www.openstreetmap.org/ --

Re: [pinax-users] Learning Django+Pinax - Recommend books and/or tutorials?

2012-01-25 Thread John Wong
I think I am qualified to give you advice. When I say "qualified", I really mean it. First, I am not a very strong programmer myself. Even as a CS student, I always feel like I am behind. Nontheless, I am always eager to learn and am very determined to debug for days. Python is not a big language

Re: foreign key select widget with "add" link

2012-01-25 Thread Ed
http://www.hoboes.com/Mimsy/hacks/replicating-djangos-admin/ -- 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/-/-SBv03JcdswJ. To post to this group, send

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread JJ Zolper
> When you are developing your Django app, the development server that > comes with Django (python manage.py runserver) works fine on Windows. > When you are ready to move things into production for everyone else > access, you should not use the development server; instead you should > use a

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
On 26 January 2012 13:14, JJ Zolper wrote: >> The keywords were 'in production'. The development server (i.e. python >> manage.py runserver) works fine under Windows. But when you want to >> make the website accessible to your audience (the internet, company >> etc.), you

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread JJ Zolper
> The keywords were 'in production'. The development server (i.e. python > manage.py runserver) works fine under Windows. But when you want to > make the website accessible to your audience (the internet, company > etc.), you should host that on Linux. I still don't quite understand. Can you

Learning Django+Pinax - Recommend books and/or tutorials?

2012-01-25 Thread Alec Taylor
A friend of mine is joining my team, but unfortunately only knows a little Python (CGI) and neither Django nor Pinax. Which books and/or online tutorials should I recommend to him? I am thinking: - https://docs.djangoproject.com/en/dev/intro/ - http://www.lightbird.net/dbe/ But not sure if the

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
On 26 January 2012 12:05, JJ Zolper wrote: >>  Unless you have a >>  preference for Windows though, I wouldn't use it as a Django app web >>  server in production; there's far less support on the net to help you >>  out when things go wrong. > > Let me see if this what you

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread JJ Zolper
> Unless you have a > preference for Windows though, I wouldn't use it as a Django app web > server in production; there's far less support on the net to help you > out when things go wrong. Let me see if this what you mean... so when I want to run "python manage.py runserver," a Django

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
On 26 January 2012 04:50, JJ Zolper wrote: > In many of the (I)DEs (PythonWin, IDLE, probably the various EMACS > and VI configurations, SciTE), one can edit a file, save it (some will > save for you if needed), then hit some key combo which will spawn a > Python interpreter

Re: django docs __unicode__ return u'%s %s

2012-01-25 Thread JohnA
Just to fill in some more info, __unicode__ methods are also part of core python and just happen to appear a lot in django code because of its preference for 16-bit unicode strings (though I think the methods are actually mostly invoked in the admin). There is also a __str__ function for

Re: admin list_filter: limit choices to model values?

2012-01-25 Thread Micky Hulse
On Fri, Jan 13, 2012 at 3:35 PM, Micky Hulse wrote: > Would it be possible for me to setup my list_filter to only show > author names that have been assigned to my flat pages? For example, > let's say I have 10 pages, and two of those pages have the been FK'd > to "bjohnson"

Re: django docs __unicode__ return u'%s %s

2012-01-25 Thread Petr Přikryl
"Krondaj wrote: >I'm using python 2.7.2 >for another model i'm forming i have: > >def __unicode__(self): >return (self.project_and_task, self.project_number, > self.date_created, self.requested_by) > >to understand (i think the new method makes a little more sense?) the >format

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread JJ Zolper
Not really I don't have any preference. Any input is welcome! -- 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/-/VoMln37CSU8J. To post to this group, send

modelForm validation -> model validation -> trigger field validation?

2012-01-25 Thread Sven
hi there, has anyone of you an idea in which cycle the field method of ForeignKey.validate is triggered? I have a custom ForeignKey Field where i override the validate method. So i expect that ModelForm validation triggers -> Model validation (clean methods) and this triggers

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread william ratcliff
Just curious--is there any particular reason that you were using Visual Studio? On Wed, Jan 25, 2012 at 12:50 PM, JJ Zolper wrote: > In many of the (I)DEs (PythonWin, IDLE, probably the various EMACS > and VI configurations, SciTE), one can edit a file, save it (some will >

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread JJ Zolper
In many of the (I)DEs (PythonWin, IDLE, probably the various EMACS and VI configurations, SciTE), one can edit a file, save it (some will save for you if needed), then hit some key combo which will spawn a Python interpreter passing it the file for execution. You may even be prompted to supply

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread JJ Zolper
Okay I am glad to hear that something I knew was on the right track! Thanks Kenneth! However what is OSM? Open Street Maps? maybe you could tell me a little bit more about it as I have not heard of it? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: model for uploading a file - not working??

2012-01-25 Thread bruno desthuilliers
On Jan 25, 4:54 pm, Krondaj wrote: (snip) > I get: > >   File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 >     upload_doc = models.FileField(upload_to 'documents') > > ^ > SyntaxError: invalid syntax > > any idea's what's up? Please re-read carefully the error

Re: model for uploading a file - not working??

2012-01-25 Thread Martin Tiršel
On Wed, 25 Jan 2012 16:54:55 +0100, Krondaj wrote: in my model i'm using: from django.db import models, datetime, MEDIA_ROOT class RrsForm(models.Model): # upload_doc = models.FileField(upload_to 'documents') I get this error when I run (before running

Re: model for uploading a file - not working??

2012-01-25 Thread Krondaj
trying to show where ^ goes: haviing problems:  i'm hoping this shows it at the last quote mark: > File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 > upload_doc = models.FileField(upload_to 'documents') >                                                                               >    

Re: model for uploading a file - not working??

2012-01-25 Thread Krondaj
trying to show where ^ goes: haviing problems:  i'm hoping this shows it at the last quote mark: > File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 > upload_doc = models.FileField(upload_to 'documents') >                                                                             >

Re: model for uploading a file - not working??

2012-01-25 Thread Krondaj
trying to show where ^ goes: haviing problems:  i'm hoping this shows it at the last quote mark: > File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 > upload_doc = models.FileField(upload_to 'documents') >                                                                             >

Re: model for uploading a file - not working??

2012-01-25 Thread Krondaj
trying to show where ^ goes: haviing problems: i'm hoping this shows it at the last quote mark: > File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 > upload_doc = models.FileField(upload_to 'documents') > ^. >

Re: model for uploading a file - not working??

2012-01-25 Thread Krondaj
upload_doc = models.FileField(upload_to 'documents') ^ On Jan 25, 3:54 pm, Krondaj wrote: > in my model i'm using: > > from django.db import models, datetime, MEDIA_ROOT > > class RrsForm(models.Model): > # > >     upload_doc = models.FileField(upload_to 'documents')

Re: model for uploading a file - not working??

2012-01-25 Thread Krondaj
the arrow should be pointing at the last quote at ') like this (hopefully): File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36 upload_doc = models.FileField(upload_to 'documents') ^ SyntaxError: invalid syntax Any idea's?? On Jan 25, 3:54 pm, Krondaj wrote: > in

model for uploading a file - not working??

2012-01-25 Thread Krondaj
in my model i'm using: from django.db import models, datetime, MEDIA_ROOT class RrsForm(models.Model): # upload_doc = models.FileField(upload_to 'documents') I get this error when I run (before running syncdb): python manage.py sql rrs I get: File

Re: django docs __unicode__ return u'%s %s

2012-01-25 Thread Krondaj
Hi Petr, I'm using python 2.7.2 for another model i'm forming i have: def __unicode__(self): return (self.project_and_task, self.project_number, self.date_created, self.requested_by) to understand (i think the new method makes a little more sense?) the format should be: def

Re: Deverifying a URLField

2012-01-25 Thread bruno desthuilliers
On Jan 25, 12:30 am, Rich Jones wrote: > Hello, all! (snip - Mike already answered) > Will I need to do a database migration > to do this? Or can I just add a 'verified=False' and run syncdb? URL Validation is done in django, not in the database, so there's no need for a

Caching and excluding in a template

2012-01-25 Thread Thorsten Sanders
Hello, wondering if there is any easy way to exclude a little part from a template to be cached, on every site there is a the usual register/login or you are logged in with a user menu, back in php+smarty times it was easy solved using a dynamic tag to easily exclude a small part from being

Re: django docs __unicode__ return u'%s %s

2012-01-25 Thread Petr Přikryl
> "coded kid" wrote: >If I may say, 'u' makes it easy to return variable with any hassle. >And %s rep each string in your script. I think there should be other >ways to go about this. Hope you get my point? This is wrong. The prefix 'u' means that the following string is a Unicode string,

Re: get_FOO_display() for generic/variable choice fields

2012-01-25 Thread katstevens
My Python-expert partner suggested a clever workaround as follows: As I'm already running through the model._meta.fields beforehand to create header row for my .csv file, I can build a dictionary of the choices to refer to later. choices_lookup_dict = {} header_row = [] for field in

Re: Determine gender from first name

2012-01-25 Thread Anoop Thomas Mathew
Hi, If you are looking for a fuzzy solution, you can find it here https://github.com/sholiday/genderPredictor This should suit your purpose. It uses nltk package for predicting, but as Kenneth said, it won't be 100% perfect. You can expect 80-90% success. Hope this helps. Thanks, Anoop atm ___

Re: Determine gender from first name

2012-01-25 Thread kenneth gonsalves
On Wed, 2012-01-25 at 09:49 +0100, Demetrio Girardi wrote: > How can I go about this? Is there a publicly available database of > first names divided by language and gender? A public web-service that > guesstimates the gender? not possible in my opinion. There may be some languages where a name

Fixture Funny : 1st Row Of Each Table Missing

2012-01-25 Thread Johan
Hi. I'm having a funny issue. I have a fixture for my static tables. They are all populated via syncdb using the fixture. On my sqlite test environment it works perfectly. On my production environment, with a MySQL database, the data is populated into the tables via the fixture except for the

Re: Determine gender from first name

2012-01-25 Thread Praveen Krishna R
*I don't know if there are any databases or webservices available for the purpose. But how would you handle the exceptions ?! Like if it does not exist in the db, and common names used across genders ?!* * * On Wed, Jan 25, 2012 at 11:49 AM, Demetrio Girardi < demetrio.gira...@gmail.com> wrote: >

Determine gender from first name

2012-01-25 Thread Demetrio Girardi
This is not a django-specific question, but I couldn't find anything useful on the subject and have no better place to ask. Let's say I want to put "welcome {{user.first_name}}" on top of my template. In many languages, "welcome" has to be declined by gender. I have no use for the user's gender