Re: Accessing Models After get_model()

2014-12-21 Thread Mike Dewhirst
Have you enabled admindocs? Might be the solution you are looking for. Connected by Motorola llanitedave wrote: >I'm trying to display a list of the models in my app on a web page, similar to >the way the Django Admin does it.  I'm not sure where the admin section is >coded, which might be

Accessing Models After get_model()

2014-12-21 Thread llanitedave
I'm trying to display a list of the models in my app on a web page, similar to the way the Django Admin does it. I'm not sure where the admin section is coded, which might be part of my problem. I'm using Django 1.7, and have built a very simple view: from django.db.models import get_app, get_

Re: Select a single field from database (postgresql)

2014-12-21 Thread Mario Gudelj
Or use .latest() On 19/12/2014 11:00 pm, "aRkadeFR" wrote: > Hello Cássio, > > You first need to map your cars table with a Model in Django > (https://docs.djangoproject.com/en/1.7/topics/db/models/), > then you can construct your query something like this: > > Car.objects.order_by('-registered'

Re: Raw access to cache table

2014-12-21 Thread Russell Keith-Magee
On Sun, Dec 21, 2014 at 12:55 PM, Collin Anderson wrote: > > Hi Erik, > > If you want a nicer interface, I just ran manage.py inspecdb on one of my > databases and got this for the cache table. Not sure why django still does > it by hand. > Gather `round, children, and let Grandpa fill you in on

Re: makemigrate adds multiple migrations.AddField for same model (django 1.7.1)

2014-12-21 Thread pjotr
Just realized the subject was wrong, it should be *makemigrations , not makemigrate* On Sunday, December 21, 2014 8:36:29 PM UTC+1, pjotr wrote: > > Hi, > > I have a django model that I just added six new fields to. I ran > *makemigrations > *and after that noticed when we ran our rehearsal upg

Re: filter Datetimefield

2014-12-21 Thread Rafael Borella
I figured out what did happen... i just needed to put midnight on timefield and it worked Thks for help!! -- 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 d

makemigrate adds multiple migrations.AddField for same model (django 1.7.1)

2014-12-21 Thread pjotr
Hi, I have a django model that I just added six new fields to. I ran *makemigrations *and after that noticed when we ran our rehearsal upgrade with dump of the production database that things took longer than we expected, and checked the processlist. We saw that there were six *alter table* st

Re: filter Datetimefield

2014-12-21 Thread Vijay Khemlani
When you print the SQL query that is executed on the database print lista_de_balada.query Does it make sense? When you see the actual value stored in the database is it stored correctly? Also remember that the month and day are 1-based (january is 1, february is 2, etc) Suerte! :D On Sun, D

Re: How to make a migration irreversible [1.7]

2014-12-21 Thread Bibhas
Hey Markus, Thanks for the suggestion. Added that snippet for now. I was kind of surprised when I could not find a way to handle the backward migrations. I created a ticket - https://code.djangoproject.com/ticket/24037 For now I don't mind the migration being irreversible. But the perfect sol

How to Display the number of active users in Django Site with IP address

2014-12-21 Thread Avinash Kunuje
How to Display the number of active users in Django Site with IP address -- 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

filter Datetimefield

2014-12-21 Thread Rafael Borella
Hi, i'm new in django and python, I'm trying to create a queryset to filter according to date. this is my MODEL : data = models.DateTimeField() and my VIEW:def resultado(request, dia, mes, ano): lista_de_balada= Balada.objects.filter(data__year=ano, data__mo

Re: How to make a migration irreversible [1.7]

2014-12-21 Thread Markus Holtermann
Hey Bibhas, thank you for the report. I can verify that behavior and would classify it as a release blocker since it leads to potential data loss. Can you open a ticket on https://code.djangoproject.com/ please. In general a migration is a collection of operations. The migration will only be u

How to make a migration irreversible [1.7]

2014-12-21 Thread Bibhas
Hi, I need to make a migration irreversible. And strangely I don't see any way to do it in the migration doc. I see that the Operation class has a property called `reversible`, but don't see any way to set it to False. I had a legacy model that was generated with inspectdb, hence it had manage

Re: Where to put my bugfix tests?

2014-12-21 Thread Markus Holtermann
Hey, Thank you for contributing. I would add the tests to somewhere in "tests/validation/". /Markus P.S.: You might want to use the django-developers mailing list for questions or discussion of the development of Django itself in the future. On Sunday, December 21, 2014 3:13:55 AM UTC+1, Андр