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

2016-04-26 Thread Mike Dewhirst
On 26/04/2016 9:41 PM, Bruce Whealton wrote: Mike, Â Â Â Â Â So, I tried your idea for reorganizing the models, and just removed Organization and instead setup ContactOrOrganization as a class. Â It seemed to work ok, in terms of migrating fine. Â However, the database now lacks a Cont

What's the best way to auto convert a model field values before it is rendered?

2016-04-26 Thread jorrit787
Do you need to do actual math with the converted values, or is it just a matter of displaying the original value as the converted value in the template to those users who prefer seeing Fahrenheit? In the latter case all you would have to do is create a custom template tag that takes the original

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Cronos Cto
Could you give me an example or so Vijay Khemali? -- 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 grou

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Vijay Khemlani
You still haven't defined a rule to handle the root path, just admin and sistema On Tue, Apr 26, 2016 at 8:56 PM, Cronos Cto wrote: > > > ´ > > > Doesnt seem to fix

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Cronos Cto
´ Doesnt seem to fix it still. I have no clue how to go further, totally new to django. -- You received this message because you are subscribed to the Google

Re: (Newbie) Stuck with annotate() docs

2016-04-26 Thread Tim Graham
Looks like a typo. Does the rest of the example make sense and work if that line is changed to "Book.objects.first().chapters"? On Tuesday, April 26, 2016 at 12:50:31 PM UTC-4, Ankush Thakur wrote: > > Folks, I'm having exceptional trouble understanding annotate(), > aggregate(), and their vario

Re: Test runner wants to run models package?!

2016-04-26 Thread Tim Graham
Could you try Python 3.4.x? I ran into some issues with Django's own test suite [0] due to some import changes in Python 3.5 [1]. [0] https://code.djangoproject.com/ticket/23763#comment:11 [1] http://bugs.python.org/issue7559 On Tuesday, April 26, 2016 at 6:04:56 PM UTC-4, Torsten Bronger wrote:

Test runner wants to run models package?!

2016-04-26 Thread Torsten Bronger
Hallöchen! With Django 1.9.5 (rest are original Ubuntu 16.04 packages) and Python 3.5.1, "manage.py test myapp" tries to run the *models* package of myapp as a test module: user@localhost:~/src/myproject/myproject$ ./manage.py test myapp --pattern=invalid_pattern Creating test database f

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Patrick Harding
maybe giving it a namespace would handle it for you? such as include('sistema.urls', namespace='sistema') if not you can try this. the error i get is that you should "pass the callable instead" which means in your imports include the views that you want to import, then call them in you url

Trying to extend the User model to create a user profile page

2016-04-26 Thread Patrick Harding
I am creating an app for our company to have users log in, create a profile page, and create updates on some personal progress. I have handled logging in and registering with django-registration, and have created the app for updates, but i'm not able to create a profile page extending the user's

What's the best way to auto convert a model field values before it is rendered?

2016-04-26 Thread Vince
I need to store and retrieve temperatures in a model. I'd like to store all the values in celsius. However some users prefer to view the value in fahrenheit. What is the recommended way to setup a model like this? Perhaps manually convert the values in the view and on save? Or is it possible

Re: Django apparently can't handle that error.

2016-04-26 Thread Michal Petrucha
On Tue, Apr 26, 2016 at 08:17:40PM +0200, Michal Petrucha wrote: > Have you considered altering the table for Log to include an ON DELETE > CASCADE clause instead? That would make the error go away without too > much effort, even though I still think the behavior you are > implementing is simply in

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Cronos Cto
I have tried the include solution. Just creates more erros as knbk said. -- 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.co

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Cronos Cto
terça-feira, 26 de Abril de 2016 às 08:33:09 UTC+1, Cronos Cto escreveu: > > > Hello Django Lovers. > > So I started on Django as project of mine. Seems like a great first > framework to start on. At the moment I am stuck at this: > > > >

Re: Django apparently can't handle that error.

2016-04-26 Thread Michal Petrucha
On Tue, Apr 26, 2016 at 10:02:32AM -0700, Neto wrote: > The right is just Account.objects.last().delete() to delete everything > related to account. > My project has many models related to account, and everything has log, is > unfeasible be deleting the rows of each model to the end delete the ac

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread knbk
Since 1.9, admin.site.urls is a special case, and you should not use include(). If you do, you'll trigger some deprecation warnings due to changes to include(). On Tuesday, April 26, 2016 at 6:33:40 PM UTC+2, Nikhil Beniwal wrote: > > The Problem is in your line 21. > > admin.site.urls should

Re: Django apparently can't handle that error.

2016-04-26 Thread Neto
The right is just Account.objects.last().delete() to delete everything related to account. My project has many models related to account, and everything has log, is unfeasible be deleting the rows of each model to the end delete the account. Django needs to handle it. Em terça-feira, 26 de abril

(Newbie) Stuck with annotate() docs

2016-04-26 Thread Ankush Thakur
Folks, I'm having exceptional trouble understanding annotate(), aggregate(), and their various combinations. I'm currently stuck here: https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations The example here uses Book.objects.first().chapters.count(), but th

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Nikhil Beniwal
The Problem is in your line 21. admin.site.urls should be wrapped inside include like :- url(r'^admin/', include(admin.site.urls)), On Tuesday, April 26, 2016 at 1:03:09 PM UTC+5:30, Cronos Cto wrote: > > > Hello Django Lovers. > > So I started on Django as project of mine. Seems like a great f

Re: How to retrieve data from deep nested object?

2016-04-26 Thread Said Akhmedbayev
Sorry guys this worked for me {% for question in subsection.question_set.all %} {{ question.question_text }} {% endfor %} My problem was that I did not realize that Django is smart enough for not to show default text in the Question body that I placed in the question model. When I i

Re: How to retrieve data from deep nested object?

2016-04-26 Thread Said Akhmedbayev
This does not work for me either :-( On Tuesday, April 26, 2016 at 7:49:41 PM UTC+6, Dan Tagg wrote: > > Does {% for question in subsection.subsection_set.all %} work? > > Dan > > On 26 April 2016 at 13:33, Said Akhmedbayev > wrote: > >> I am trying to figure out how to loop over deep nested obje

Re: How to retrieve data from deep nested object?

2016-04-26 Thread Said Akhmedbayev
Unfortunately, it does not work for me :-( On Tuesday, April 26, 2016 at 7:49:39 PM UTC+6, Vijay Khemlani wrote: > > I guess it is > > {% for question in subsection.question_set.all %} > > based on your models > > On Tue, Apr 26, 2016 at 9:33 AM, Said Akhmedbayev > wrote: > >> I am trying to fig

Re: How to retrieve data from deep nested object?

2016-04-26 Thread Dan Tagg
Does {% for question in subsection.subsection_set.all %} work? Dan On 26 April 2016 at 13:33, Said Akhmedbayev wrote: > I am trying to figure out how to loop over deep nested object in Django > template. > > Here is my app's code > > models.py > > from django.db import models > > > class Unit(m

Re: How to retrieve data from deep nested object?

2016-04-26 Thread Vijay Khemlani
I guess it is {% for question in subsection.question_set.all %} based on your models On Tue, Apr 26, 2016 at 9:33 AM, Said Akhmedbayev wrote: > I am trying to figure out how to loop over deep nested object in Django > template. > > Here is my app's code > > models.py > > from django.db import

Re: Using django login functionality in a non django app

2016-04-26 Thread Gergely Polonkai
That means you have to be able to do it via the API. The other solution is to pop up a web view for these tasks. However, we are moving out from Django field here, as this is getting more and more a falcon/UX-related question. Gergely Polonkai [image: https://]about.me/gergely.polonkai

Re: New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Cristiano Valente
You have defined no view to handle the root url. You only have two routes: ^/sistema and ^/admin. Besides, you should wrap admin.site.url in an include(). Il giorno martedì 26 aprile 2016 09:33:09 UTC+2, Cronos Cto ha scritto: > > > Hello Django Lovers. > > So I started on Django as project of mi

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

2016-04-26 Thread Bruce Whealton
Having followed all the suggestions, I am now stuck. I have simplified the database by removing one model. I get to the point of python manage.py makemigrations and it returns with what looks right. However, the migrate command just throws out a bunch of errors. For some reason, it is looki

How to retrieve data from deep nested object?

2016-04-26 Thread Said Akhmedbayev
I am trying to figure out how to loop over deep nested object in Django template. Here is my app's code models.py from django.db import models class Unit(models.Model): unit_number = models.PositiveIntegerField(blank=True, null=True, default=1) title = models.CharField(max_length=15

Re: Using django login functionality in a non django app

2016-04-26 Thread Larry Martell
I need to support create user, change password, delete user and forgot password. On Tue, Apr 26, 2016 at 7:32 AM, Gergely Polonkai wrote: > > > That’s not a big issue if you really communicate with Django via a web-based > API. If the user can’t log in, you can simply redirect them to a web page

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

2016-04-26 Thread Bruce Whealton
Mike, So, I tried your idea for reorganizing the models, and just removed Organization and instead setup ContactOrOrganization as a class. It seemed to work ok, in terms of migrating fine. However, the database now lacks a ContactsOrOrganization table. Oops, my mistake, it does hav

Re: Using django login functionality in a non django app

2016-04-26 Thread Gergely Polonkai
That’s not a big issue if you really communicate with Django via a web-based API. If the user can’t log in, you can simply redirect them to a web page. I don’t see the need for user admin functions, though. Gergely Polonkai [image: https://]about.me/gergely.polonkai

Re: Using django login functionality in a non django app

2016-04-26 Thread Larry Martell
Well, the issue with simply implementing auth, is that we'd need to not only implement login, which is easy, but also forgot password, and all the user admin functions. Since we have that already with django I want to leverage that and not reinvent the wheel. On Tue, Apr 26, 2016 at 2:29 AM, Gerge

Re: Support Please

2016-04-26 Thread Daniele Procida
On Tue, Apr 26, 2016, Katie Chubb wrote: >I need to get in contact with someone who can help me make changes to the >client facing home page. I am new to the marketing role at the company and >the details have not been passed on. Is there anyone who can help me with >this? Without knowing de

Support Please

2016-04-26 Thread Katie Chubb
Hi I need to get in contact with someone who can help me make changes to the client facing home page. I am new to the marketing role at the company and the details have not been passed on. Is there anyone who can help me with this? Thanks -- You received this message because you are subscr

Re: Django 1.9 Apps aren't loaded yet

2016-04-26 Thread marcin . j . nowak
On Monday, April 25, 2016 at 11:44:20 PM UTC+2, marcin@gmail.com wrote: > Just wondering about possibility to do some kind of late initialization. I've found Dectate library as a example of deferring configuration phase. I'm not talking about using it

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

2016-04-26 Thread Bruce Whealton
OK, for starters, I understand the need for Null=True and blank=True. So, jumping down...Not sure a better way to do this but I will leave my comments for reference including my models and then respond to the questions So sorry for my delay, I wasn't well this past weekend. >> >> My proble

Django rest registration

2016-04-26 Thread nitish patkar
I am using Django-rest-auth (https://github.com/Tivix/django-rest-auth) in my django project for login and registration. I see a default registration form as in attached file. Currently I am being able to register a new user with email instead of username. The default auth_user table in my MySq

New to Django (stuck at the end of the tutorial)

2016-04-26 Thread Cronos Cto
Hello Django Lovers. So I started on Django as project of mine. Seems like a great first framework to start on. At the moment I am stuck at this: This was after

emailuser accessor clash after migrating to Django 1.6

2016-04-26 Thread schaf . mh
HI All, In an existing project I got the following error after upgrading to Django 1.6.11 CommandError: One or more models did not validate: emailuser.emailuser: Accessor for m2m field 'groups' clashes with related m2m field 'Group.user_set'. Add a related_name argument to the definition for 'gr

Re: FieldError: Invalid order_by arguments: ['- pub_date']

2016-04-26 Thread Michal Petrucha
On Mon, Apr 25, 2016 at 08:49:47AM -0700, gu99r...@student.chalmers.se wrote: > Ok, I looked at the tutorial page more closely. When you look at the code, > it looks like there is a space after the minus sign, especially when you > mark text. But if I copy and paste the text into some arbitrary t