Re: Complex content type

2016-05-02 Thread ludovic coues
I have some trouble trying to understand what you means by "content type". That terms refer to the content of a file. For exemple, text/plain for plain text file or image/png for an image encoded as png. What you show look like a standard form. If you need basic pointer on how to use a form, saving

Re: Complex content type

2016-05-02 Thread Said Akhmedbayev
Thank you ludovic and sorry for not being able to clearly explain what I want to do :-(. You are right, I want to show a user a simple django form, but I cannot figure out how to save an individual answer alone with its correspondence question's id and user's id So my table for "Answer" model w

Re: Complex content type

2016-05-02 Thread ludovic coues
You might want to add a foreign key in the answer model pointing to the question. Then in the view to show the form, create an answer object with it's question FK assigned to the question and create a form from that answer. In the view processing the form, you should get that object back, with the

manipulate n insert field values

2016-05-02 Thread Shameema Mohsin
i have 2 fields latitude n longitude, and need to calculate z order value of lat n long n insert to a field -- 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 djan

Re: manipulate n insert field values

2016-05-02 Thread Shameema Mohsin
Could anybody help me out as I am new to Django. *In my model:* from django.db import models class Employees(models.Model): empId = models.AutoField(primary_key=True) empName = models.CharField(max_length=200) empEmail = models.EmailField() empMob = models.CharField(max_length=200

Re: Complex content type

2016-05-02 Thread Said Akhmedbayev
Ludovic, would you be so kind to help me and put together some example code of what I should place in the forms.py and the views.py? I would greatly appreciate. On Monday, May 2, 2016 at 4:25:13 PM UTC+6, ludovic coues wrote: > > You might want to add a foreign key in the answer model pointing

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-02 Thread Bruce Whealton
As an update to this... I decided to simplify things a bit. For my contacts application, I decided to start with just one table. I got that working in a Ubuntu Vbox environment, inside a virtualenv. I'm not sure if it is ok to use python manage.py makemigrations on the production server o

Re: manipulate n insert field values

2016-05-02 Thread Erik Cederstrand
> Den 2. maj 2016 kl. 15.38 skrev Shameema Mohsin : > > Could anybody help me out as I am new to Django. > In my model: > > from django.db import models > > class Employees(models.Model): >empId = models.AutoField(primary_key=True) >empName = models.CharField(max_length=200) >empEma

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-02 Thread Michal Petrucha
On Mon, May 02, 2016 at 08:37:43AM -0700, Bruce Whealton wrote: > I'm not sure if it is ok to use python manage.py makemigrations on the > production server or if one should just do that locally and then import it. Hi Bruce, Migrations are a part of your application's code base, and they should

Trying to make a POST call to a Django view

2016-05-02 Thread carloratm
hello everyone, I am a frontend developer studying Django, so please forgive my noobish question... I am trying to make a simple ajax call working. I have a form in a template. I would like to use that form to save an object into the database (asynchronously). On form submit event: * I prevent r

Re: Trying to make a POST call to a Django view

2016-05-02 Thread ludovic coues
I would use the browser developer tools to look at what JQuery is sending to django in the submit event. 2016-05-02 18:01 GMT+02:00 carloratm : > hello everyone, > I am a frontend developer studying Django, so please forgive my noobish > question... > I am trying to make a simple ajax call working

Re: Complex content type

2016-05-02 Thread ludovic coues
There is such example in the django girls tutorial I linked earlier. 2016-05-02 15:48 GMT+02:00 Said Akhmedbayev : > Ludovic, would you be so kind to help me and put together some example code > of what I should place in the forms.py and the views.py? I would greatly > appreciate. > > On Monday,

Python3 + makemessages = "invalid multibyte sequence"

2016-05-02 Thread Torsten Bronger
Hallöchen! With Django 1.9.5 and Python 3, I get warnings like ./jb_common/templates/404.html.py:35: invalid multibyte sequence when I run "manage.py makemessages". The problem occurs only in HTML files with (validly) UTF-8-encoded characters in them. In the .po file, these characters are skip

Re: Complex content type

2016-05-02 Thread Aaron Cannon
To your Answer class, you could just add a field like: question = models.ForeignKey(Question, on_delete=models.CASCADE) It may be as simple as that. Does that help? Aaron On 5/2/16, ludovic coues wrote: > There is such example in the django girls tutorial I linked earlier. > > 2016-05-02

makemigrations throws table does not exist error

2016-05-02 Thread Lucian Willoughby
I am trying to recreate a django project from a git repository that I have. I don't have the original database. I have emptyied all of the migration folders but when I run "python manage.py makemigrartions" I get the following error ("Table 'age-sdb.login_esm_systems_experience_choice' doesn't

makemigrations throws table does not exist error

2016-05-02 Thread Lucian Willoughby
I am trying to re-create an older project from a git repository. I do not have the original MySql database. I emptied the migration folders and tried to run "python manage.py makemigrations" which resulted in the following error : "Table 'age-sdb.login_esm_systems_experience_choice' doesn't exi

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-02 Thread Bruce Whealton
Michal, I had to read your response a few times but I finally got it. I was reading that all migrations are created in development only and then applied during production. So, during development you use makemigrations and then when deployed you migrate. Thus, if you add a new feature

Help with moving a development project to production

2016-05-02 Thread Bruce Whealton
Hello all, I have been developing a django project and app on a Ubuntu system. My production system is Centos 6 based ( I think, not Centos 7). First off, what should I commit to the repo? I setup a virtualenv using virtualenvwrapper. This included a bin directory, include directory

Re: Help with moving a development project to production

2016-05-02 Thread Ryan Nowakowski
On Mon, May 02, 2016 at 03:07:57PM -0700, Bruce Whealton wrote: > I have been developing a django project and app on a Ubuntu > system. My production system is Centos 6 based ( I think, not Centos 7). > First off, what should I commit to the repo? I setup a virtualenv using > virtual

[ANNOUNCE] Django bugfix releases issued: 1.9.6 and 1.8.13

2016-05-02 Thread Tim Graham
Details are available on the Django project weblog: https://www.djangoproject.com/weblog/2016/may/02/bugfix-releases/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubsc

Re: manipulate n insert field values

2016-05-02 Thread Shameema Mohsin
Thank you Erik. I will try the property method. -- 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,

Re: manipulate n insert field values

2016-05-02 Thread Shameema Mohsin
Stil stuck with the z order calculation and usage of the property field. Kindly help. I am new to Django, only knows php well. -- 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, se

Chinese humanize number conversion

2016-05-02 Thread Malte
Hi, The Chinese humanization of numbers is not correct for large and very large numbers. 1.400.000 converts into 1.4 百万 but should be 140万 166,200,000,000 converts into 166.2十亿 but should be 1662亿 I just looked through the Django core code but couldn't find where that conversion takes place. Wh

Re: Trying to make a POST call to a Django view

2016-05-02 Thread Carlo Ascani
2016-05-02 18:11 GMT+02:00 ludovic coues : > I would use the browser developer tools to look at what JQuery is > sending to django in the submit event. http://dpaste.com/2MQTNZP I do not see anything wrong there... Any ideas? Thank you > > 2016-05-02 18:01 GMT+02:00 carloratm : >> hello everyon

Re: Trying to make a POST call to a Django view

2016-05-02 Thread Jani Tiainen
On 02.05.2016 19:01, carloratm wrote: hello everyone, I am a frontend developer studying Django, so please forgive my noobish question... I am trying to make a simple ajax call working. I have a form in a template. I would like to use that form to save an object into the database (asynchron

Re: Django Multiple User Profiles Best Practices

2016-05-02 Thread Peter of the Norse
> On Apr 6, 2016, at 9:41 PM, Sudhanshu Shekhar wrote: > > Hi, > > I am creating a tutor-student forum using Django. For which I need to have > two different user profiles, one for students and one for teachers. However, > I am unsure about the best way to do this. I am currently following the

Integer field choice list keeps triggering migration

2016-05-02 Thread jorrit787
I have the following model and choice list: BTW_TARIEF_CHOICES = { (1, '6%'), (2, '21%'), (3, '0%'), } class FactuurItem(models.Model): naam = models.CharField(max_length=100) factuur_naam = models.CharField(max_length=100) eenheid = models.CharField(max_length=10) pr