Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Russell Keith-Magee
On Thu, Aug 22, 2013 at 2:11 PM, Radomir Wojcik wrote: > Also why did from django.contrib.auth.views.login become case sensitive? I > have users that login with User and user, in PostgreSQL this is treated as > 2 different things. Using MySQL it always saw it as one.. all very > frustrating. > Dj

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Radomir Wojcik
Also getting a bunch of these too: Non-ASCII character '\xc3' in file /var/web/mandala_env/mandala/alarms/views.py on line 329, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (views.py, line 329) Is this normal? PostgreSQL is more strict with character types

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Xavier Ordoquy
Hi, Le 22 août 2013 à 08:25, Radomir Wojcik a écrit : > Adding the unicode u to the 'string' as such u'string' fixes the issue but > now I have to add this u to every string that will potentially have a > character with a french accent in it? How come MySQL didn't need this? There > must be

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Radomir Wojcik
Adding the unicode u to the 'string' as such u'string' fixes the issue but now I have to add this u to every string that will potentially have a character with a french accent in it? How come MySQL didn't need this? There must be a straight forward answer to this, something that will make Post

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Radomir Wojcik
Also why did from django.contrib.auth.views.login become case sensitive? I have users that login with User and user, in PostgreSQL this is treated as 2 different things. Using MySQL it always saw it as one.. all very frustrating. I will try SQLite tomorrow maybe instead, been up 2 days straigh

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Radomir Wojcik
> > Its not a problem with the conversion process. I re-created the schema > using django syncdb and then I went table by table putting the data back in > using csv files I exported from MySQL. I took the long way to get this all > in and PostgreSQL had no problems taking my csv data as input.

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Russell Keith-Magee
On Thu, Aug 22, 2013 at 1:37 PM, Radomir Wojcik wrote: > > And I tried with both UTF8 and LATIN1 database encodings, both produce the > same error: > > List of databases >Name| Owner | Encoding | Collate |Ctype| Access > privileg > es > >

Re: Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Radomir Wojcik
And I tried with both UTF8 and LATIN1 database encodings, both produce the same error: List of databases Name| Owner | Encoding | Collate |Ctype| Access privileg es ---+--+--+-+-+---

Can't decode french characters after switching to PostgrSQL from MySQL

2013-08-21 Thread Radomir Wojcik
my code worked fine up until I switched to PostgreSQL from MySQL. Now I am bombarded with these errors whenever I have french accents in my strings. My database is correctly configured with LATIN1 (as UTF8 didn't like the accents when trying to import them from MySQL, the default was UTF8). My

Re: How do I create a script to fill in django admin login form and submit?

2013-08-21 Thread 7equivalents
Thank you so much! You really helped me. I went back and checked the source code sent to my browser and did indeed see, name = "this_is_the_login_form'. I was using the "ID" rather than the "name". My weakness in html kicked me this time, thanks for lending a hand! > > > > -- You received

Re:

2013-08-21 Thread yati sagade
I think we all got it. On Wed, Aug 21, 2013 at 11:52 PM, Roberto López López wrote: > I got it as well. > > > > > On 08/21/2013 07:50 PM, Mike Doroshenko II wrote: > > How/Why am I getting this? Has anyone else received this? > > To: django-users+unsubscr...@googlegroups.com > > On 08/21/2013 0

Re: How do I create a script to fill in django admin login form and submit?

2013-08-21 Thread Kelvin Wong
I've used Requests in the past. All I did was load the page in Chrome and then I looked at what was being sent and compared it to what your script was sending. When I added the missing key it worked. Trial and error. :) K On Wednesday, August 21, 2013 8:48:16 AM UTC-7, 7equiv...@gmail.com w

Re: Django ORM: default value from sql query

2013-08-21 Thread Marcin Szamotulski
I should be more specific: I cannot because the query depends on the object instance: class MyModel(models.Models): fkey = models.ForeignKey(..., null=False) count = models.PosotiveIntegerField(default=lambda:MyModel.objects.filter(fkey_id= _?_ ).count()) where _?_ should be the mod

Re: Using an external Server to serve Static files - Development Server

2013-08-21 Thread Kelvin Wong
This is how I do it. In settings.py: STATIC_ROOT = '/home/user/app/site_media/static/' # Generated files here from 'manage.py collectstatic' STATIC_URL = 'http://static.example.com/static/' In templates: {% load staticfiles %} ... Produces: http://static.example.com/static/myapp/stylesh

Re: Using an external Server to serve Static files - Development Server

2013-08-21 Thread Ideo Rex
{% load staticfiles %} This is just for my css file (there are other categories under lifestream. server: https://my.site.com/DJStatic/static/livestream/css/style.css On Wednesday, August 21, 2013 6:18:37 PM UTC-7, Nikolas Stevenson-Molnar wrote: > > That should work... how are you referencin

Re: Using an external Server to serve Static files - Development Server

2013-08-21 Thread Nikolas Stevenson-Molnar
That should work... how are you referencing your static files from your templates? _Nik On 8/21/2013 6:09 PM, Ideo Rex wrote: > Hello, > I have a different request that I couldn't find anywhere else on the > internet. I'm an intern who has built a Django Web Application for my > project (basicall

Using an external Server to serve Static files - Development Server

2013-08-21 Thread Ideo Rex
Hello, I have a different request that I couldn't find anywhere else on the internet. I'm an intern who has built a Django Web Application for my project (basically a large experiment). The cite will never leave development, but I'm holding my static files and templates on another server. I wan

Re: Django ORM: default value from sql query

2013-08-21 Thread Simon Charette
You can achieve this by setting a callable default value [1] on you field: class MyModel(models.Model): count = models.PositiveIntegerField(default=lambda:MyModel.objects.count()) [1] https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.default Le mercredi 21 août

Re: Dynamic increasing choices object

2013-08-21 Thread Simon Charette
Not really Django related but you can achieve it by doing the following: WEIGHTS = tuple( (weight, "%dkg" % weight) for weight in range(40, 251) ) Le mercredi 21 août 2013 18:16:59 UTC-4, Gerd Koetje a écrit : > > > How do i automatic increase this from 40 tot 250kg > its a choices field insi

Django ORM: default value from sql query

2013-08-21 Thread Marcin Szamotulski
Dear Django users, I am would like to set a default value on a model's field as a result of a simple query. Something that in SQLAlchemy is done like that: http://docs.sqlalchemy.org/en/rel_0_7/core/schema.html#sql-expressions Specifically I want to count some objects in the database and set

Re: Dynamic increasing choices object

2013-08-21 Thread Gerd Koetje
i used php to solve my issue for now, builded the object and copy pasted it ('',''), -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsub

Dynamic increasing choices object

2013-08-21 Thread Gerd Koetje
How do i automatic increase this from 40 tot 250kg its a choices field inside of models.py WEIGHTS = ( ('40','40kg'), ('41','41kg'), ) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Populate choices from model

2013-08-21 Thread Rafael E. Ferrero
you can read this too http://www.protocolostomy.com/2009/08/21/lessons-learned-while-creating-a-generic-taxonomy-app-for-django/ https://github.com/bkjones/django-taxonomy 2013/8/21 Gerd Koetje > example of what im doing > > > > from django.db import models > > from django.contrib.auth.models

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
example of what im doing from django.db import models from django.contrib.auth.models import User from django.contrib.sites.models import Site # Create your models here. # formulier keuze databases class Kleurogen_data (models.Model): name = models.CharField(max_length=255

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
example of what im doing so far from django.db import models from django.contrib.auth.models import User from django.contrib.sites.models import Site # Create your models here. # formulier keuze databases class Kleurogen_data (models.Model): name = models.CharField(max_lengt

Re: Populate choices from model

2013-08-21 Thread Rafael E. Ferrero
I design a model structure to persist restrictions to a selectable category (i dont say that its ok... its for shore that can do a lot of improvements), and make a module to admin categories with that if i choose some category to my contact first i check if i really can add that category to my cont

Re: How can I get value from a FK model?

2013-08-21 Thread Fellipe Henrique
To add in my last comment, I need the Query bring me all related fields in all models.. all fields in one SQL, to get this field value in my template. Regards, Em quarta-feira, 21 de agosto de 2013 17h52min50s UTC-3, Fellipe Henrique escreveu: > > Ok, I have make a mistake, the correct is idped

Re: How can I get value from a FK model?

2013-08-21 Thread Fellipe Henrique
Ok, I have make a mistake, the correct is idpedido is only FK. and 'iditenspedido' is a PK, the correct model is this: class ItensPedido(models.Model): iditenspedido = models.IntegerField('Código', primary_key=True, default=-1) idpedido = models.ForeignKey('Pedido', db_column='idpedido',

Re: How can I get value from a FK model?

2013-08-21 Thread Daniel Roseman
On Wednesday, 21 August 2013 20:53:36 UTC+1, Fellipe Henrique wrote: > Hi, > > I got this models: http://pastebin.com/w2TmyLzt > > First: I used db_columns because I used a legacy database from company ERP. > > I try to get, in my template the "descricao" field, in my "mercadoria" > model. but I

How can I get value from a FK model?

2013-08-21 Thread Fellipe Henrique
Hi, I got this models: http://pastebin.com/w2TmyLzt First: I used db_columns because I used a legacy database from company ERP. I try to get, in my template the "descricao" field, in my "mercadoria" model. but I have in my "itenspedido" only "idproduto" not "idmercadoria". My question is: how

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
i would vote for the m2m model, but i think i loose it there a bit -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To

Re: Populate choices from model

2013-08-21 Thread Rafael E. Ferrero
In djangoproject link its this example... MEDIA_CHOICES = ( ('Audio', ( ('vinyl', 'Vinyl'), ('cd', 'CD'), ) ), ('Video', ( ('vhs', 'VHS Tape'), ('dvd', 'DVD'), ) ), ('unknown', 'Unknown'), ) Maybe you can use some

Re: Django performance compared to other web frameworks

2013-08-21 Thread Urs Beerli
Hi Alex Thanks a lot for your considerable answer. Yeah, I probably can not avoid it to (pre-) build up my own 'test' environment and check the performance for my needs. Cheers -Urs Am 21.08.2013 19:39 schrieb "Alex Mandel" : > On 08/21/2013 10:10 AM, urs.beerli wrote: > > Hi folks! > > > > I am

Re:

2013-08-21 Thread Roberto López López
I got it as well. On 08/21/2013 07:50 PM, Mike Doroshenko II wrote: > How/Why am I getting this? Has anyone else received this? > > To: django-users+unsubscr...@googlegroups.com > On 08/21/2013 02:44 AM, Shahmi Junoh wrote: >> Hi, >> >> I would like to unsubscribe from getting the updates. >> >>

Re: How to sync database and/or discard/disable cache?

2013-08-21 Thread Javier Guerra Giraldez
On Tue, Aug 20, 2013 at 11:17 PM, Dig wrote: > These 2 situation not 100% happened (but > 30%), I guess it caused some > cache (django cache or mysql cache). AFAIK, there's no "django cache". so i'm guessing some transaction mess. maybe in that 30% cases some queries are done by different proc

Re:

2013-08-21 Thread Mike Doroshenko II
How/Why am I getting this? Has anyone else received this? To: django-users+unsubscr...@googlegroups.com On 08/21/2013 02:44 AM, Shahmi Junoh wrote: Hi, I would like to unsubscribe from getting the updates. Thanks in advance. Regards, Shahmi -- You received this message because you are subscr

Re: Django performance compared to other web frameworks

2013-08-21 Thread Alex Mandel
On 08/21/2013 10:10 AM, urs.beerli wrote: > Hi folks! > > I am pretty new to Django and what I have seen so far is very nice, I like > it a lot! But one of the most important things to me of a web framework is > the performance. If you take a look at: > http://www.techempower.com/benchmarks/#sec

Django performance compared to other web frameworks

2013-08-21 Thread urs.beerli
Hi folks! I am pretty new to Django and what I have seen so far is very nice, I like it a lot! But one of the most important things to me of a web framework is the performance. If you take a look at: http://www.techempower.com/benchmarks/#section=data-r6&hw=i7&test=update Django scores not that

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
im building a prety complicated user detail form with all kinds of fields, like: gender,haircolor,skincolor some fields have to become dropdowns with only 1 choise out of many and some fields have to become multiple select fields with alot of choise (multiple choises allowed) I was trying to us

Re: Populate choices from model

2013-08-21 Thread C. Kirby
Why are you trying to link to another model with a CharField and not a ForeignKey? You seem to be trying to do something that is almost certainly not the way is should be done. Perhaps you should explain what you are trying to accomplish. On Wednesday, August 21, 2013 10:44:55 AM UTC-5, Gerd Ko

Re: Django Periodic tasks

2013-08-21 Thread Some Developer
On 20/08/13 21:36, Arnold Krille wrote: On Sat, 17 Aug 2013 03:36:29 +0100 Some Developer wrote: I'm aware of django-cron and django-celery, both of which are capable of doing what I want but I was wondering if I was just making a fundamental design mistake and there maybe a better option that

Re: ManyToManyField select only results that match

2013-08-21 Thread Tom Lockhart
On 2013-08-21, at 7:25 AM, Gerd Koetje wrote: > He Thomas, ur right i didnt explain myself very well. > > > What im trying todo is this. > > I have a mode that holds all my form field values in difrant group , name: > Keuzes > Now i want to populate multiple form fields with these values b

Re: How do I create a script to fill in django admin login form and submit?

2013-08-21 Thread 7equivalents
Thankyou Wongo Bongo! Your solution was spot on correct. It came down to one line of code that I modified that was the problem. login_data = {'username':'jim', 'password':'beam', 'this_is_the_login_form':'1', 'csrfmiddlewaretoken':csrftoken} You gave me the correct line, however the, 'this_is_t

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
regio = models.CharField(max_length=100, choices=Regio, default= 'Amsterdam') land = models.CharField(max_length=100, choices=Landen, default= 'Nederland') (django-env)[root@python pythondating]# python manage.py syncdb CommandError: One or more models did not validate: profielen.profi

Re: Populate choices from model

2013-08-21 Thread C. Kirby
If you want your field to represent another model you should be using a foreign key, not a CharField regio = models.ForeignKey(Regio, default = Regio.objects.get(name = "Amsterdam")) On Wednesday, August 21, 2013 10:24:11 AM UTC-5, Gerd Koetje wrote: > > Hi all, > > How do i populate choices fr

Re: Populate choices from model

2013-08-21 Thread Rafael E. Ferrero
look here https://docs.djangoproject.com/en/1.5/ref/models/fields/#django.db.models.Field.choices "... note that choices can be any iterable object – not necessarily a list or tuple. This lets you construct choices dynamically. But if you find yourself hacking choices

Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
And I forgot to say thanks, I appreciate the help and guidance. derrick On Wednesday, August 21, 2013 10:23:12 AM UTC-3, Mauro Rocco wrote: > > Hi, > The 34 is the id of the pool record in the database. This means that you > don't have a pool with that ID in the database. > If you already create

Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
Thomas, like I explained to Mauro it was just confusing. Really I should have known the problem, I was working on it all last night and I guess I needed a break. That said, the tutorial is not clear. In line with the rest of the tutorial they should have used 1, vice 34. It works perfect with 1.

Populate choices from model

2013-08-21 Thread Gerd Koetje
Hi all, How do i populate choices from a model class inside models.py doenst work: regio = models.CharField(max_length=100, choices=list(Regio), default= 'Amsterdam') regio = models.CharField(max_length=100, choices=Regio, default='Amsterdam') -- You received this message because you are sub

Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
Mauro, I kind of thought that may be the case. I guess my main issue it is very confusing. Creating views is brand new to me, then the authors tell me to do something that up to that point has not been created. Up to that point there is 1 record, where did they come up with 34? And where this t

Re: Can I make changes in Django without having to recompile everything?

2013-08-21 Thread Tim Chase
On 2013-08-21 07:21, Johann wrote: > Please tell me if this is true. I'm deciding on Django, asp.net, > or Java. > > If I use asp.net or java and I want to make a change to the > controller, I have to recompile the class or project, right? Alas, that's one of the reasons that drove me from Java

Re: Can I make changes in Django without having to recompile everything?

2013-08-21 Thread Andreas Kuhne
If you compare Django to asp.net or java, django is the easiest to start things with. You never have to compile anything in django, the server does it itself. In development mode it will recompile all classes automatically when you make changes to a file. In a production environment, you may have t

Re: ManyToManyField select only results that match

2013-08-21 Thread Gerd Koetje
He Thomas, ur right i didnt explain myself very well. What im trying todo is this. I have a mode that holds all my form field values in difrant group , name: Keuzes Now i want to populate multiple form fields with these values based on wich groep i want them to be. I onloy seem to get this t

Can I make changes in Django without having to recompile everything?

2013-08-21 Thread Johann
Please tell me if this is true. I'm deciding on Django, asp.net, or Java. If I use asp.net or java and I want to make a change to the controller, I have to recompile the class or project, right? If I use Django, if I change the controller or model logic, do I have to compile everything? If I

Re: ManyToManyField select only results that match

2013-08-21 Thread Tom Lockhart
On 2013-08-21, at 3:46 AM, Gerd Koetje wrote: > anyone willing to help out? I was confused by your original example, talking about a form but then showing just one field in a model definition. So I was waiting to learn something from a knowledgable response. Instead you are stuck with my gues

Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Tom Lockhart
On 2013-08-20, at 9:02 PM, Diek Kearney wrote: > I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the > current point everything was running smoothly, then I hit a wall that I > cannot figure out. Maybe I am too focused on following, anyways I need some > help. > ... > Th

Re: Problem with translations

2013-08-21 Thread Andreas Kuhne
We are running nginx for static files and apache + mod_wsgi for the django website. Regards, Andréas 2013/8/21 Mauro Rocco > Hi, > That's strange. > To me looks like the server from time to time can not access this files as > you said. > What you use in production Apache/ModWSGI ? > > Regards

Re: Problem with translations

2013-08-21 Thread Mauro Rocco
Hi, That's strange. To me looks like the server from time to time can not access this files as you said. What you use in production Apache/ModWSGI ? Regards On Wednesday, August 21, 2013 2:57:51 PM UTC+2, Andréas Kühne wrote: > > Hi, > > I am working on a website that is available in 10 differen

Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Mauro Rocco
Hi, The 34 is the id of the pool record in the database. This means that you don't have a pool with that ID in the database. If you already created some pool object you will probably see something if you navigate to this url /polls/1/results/. If also in this case you got 404 make sure you actual

Re: How do I create a script to fill in django admin login form and submit?

2013-08-21 Thread 7equivalents
Still trying to solve this. I cant seem to find anything by googling. I did read this. https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.login However, when I'm doing this from the shell, I'm not sure what to use as request in the Login(request,user) function. Also

Problem with translations

2013-08-21 Thread Andreas Kuhne
Hi, I am working on a website that is available in 10 different languages, and we have the translations working. If you want to see our website in french, you just add /fr to our url and it works fine. However we are getting a lot of : File "middleware.py", line 83, in process_request tran

How to sync database and/or discard/disable cache?

2013-08-21 Thread Dig
Hi, I'm going to deploy my Django application to Amazon Web Service (AWS), and found some strange with AWS RDS (Relational Database Service, I choose MySQL 5.5 with InnoDB Engine). My application is running in Django 1.5, and Python 2.6, I found following behavior: Case A: Request 1: Delet

Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the current point everything was running smoothly, then I hit a wall that I cannot figure out. Maybe I am too focused on following, anyways I need some help. After I updated Polls/urls.py: from django.conf.urls import patter

Django error with installing reviewboard on solaris.

2013-08-21 Thread tomoya . fujita825
I'm trying to install reviewboard on solaris 10, but this Django problem stops me to do that. Does anyone know how to get through this problem? (python is 2.4) bash-3.2# pwd /home/fujita/Downloads/Django-1.3.7 bash-3.2# python setup.py install ... snip bash-3.2# ls -lt /usr/lib/python2.4/s

Re: ManyToManyField select only results that match

2013-08-21 Thread Gerd Koetje
anyone willing to help out? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to djang

Re: How to edit many-to-many relationships with data from custom intermediary table?

2013-08-21 Thread DJ-Tom
I'm not sure what the easiest way would be to make the Quantity field > editable - I thought about a* fieldset *but how do I get the data from > the intermediary table into that??? > > ooops - I meant FORMset, not fieldset... (why is there no way to edit my own post?) -- You received this m

How to edit many-to-many relationships with data from custom intermediary table?

2013-08-21 Thread DJ-Tom
Hi, I'm currently working on a room management application for events. One part of it is a list of room setups with associated equipment, each room can have an arbitrary number of different equipment (such as screens, IT-equipment, A/, tables etc.) Each equipment also has an attribute "number

Re: online Django users directory ?

2013-08-21 Thread Fabrice Romand
perfect 2013/8/21 Russell Keith-Magee > Hi Fabrice: > > Sounds like you're looking for: > > https://people.djangoproject.com > > Yours, > Russ Magee %-) > > > On Wed, Aug 21, 2013 at 5:03 AM, Fabrice Romand > wrote: > >> Hi, >> >> Do you know any online Django users directory ? >> >> if not, w

[no subject]

2013-08-21 Thread Shahmi Junoh
Hi, I would like to unsubscribe from getting the updates. Thanks in advance. Regards, Shahmi -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsu

Re: online Django users directory ?

2013-08-21 Thread Russell Keith-Magee
Hi Fabrice: Sounds like you're looking for: https://people.djangoproject.com Yours, Russ Magee %-) On Wed, Aug 21, 2013 at 5:03 AM, Fabrice Romand wrote: > Hi, > > Do you know any online Django users directory ? > > if not, will you support a such project ? > > > -- > You received this messa