Show a model on the admin list index page

2014-10-06 Thread Andrea
Let's suppose I have a Foo app with a Bar model with a owner field. I want a user to be able to edit all the instances for which obj.owner == request.user. The model appears correctly in the admin panel for superusers and for users for which I have explicitly assigned the permission change_bar or

Re: How can I implement Ajax pagination without side modules like endless-pagination

2014-10-06 Thread Collin Anderson
copy/pasting from a recent website I worked on for an example... we actually just had a "load more" button without showing the total number of pages. Not saying you should do it this way, but it's one possible way. def listing(request): new_list = NewPost.objects.all() if request.GET.get(

Re: Customize admin look & fee (Django 1.7 / Windows)

2014-10-06 Thread Bit Rainbow
Did you ever get an answer to this, I'm a bit unsure on why my template files aren't working? On Friday, September 26, 2014 7:41:27 AM UTC+1, Dario Chemello wrote: > > Uhm. > > site_title|default:_('Dario Administration') > > > Is site_title valorized??? > I think, if yes, that the problem i

not django just sql

2014-10-06 Thread Tsolmon Narantsogt
Sorry guys. Asking non releated subject... i have table that below structure. *id name lang* 1|Test | en 1|Тест | ru *now i wanna get in one row like this* id | name_en | name_ru 1 | Test | Тест | How to get like this. im using mysql. Thanks. -- You received this message because you are sub

How can I implement Ajax pagination without side modules like endless-pagination

2014-10-06 Thread Artie
I need to make ajax pagination in my project and not allowed to use side modules like dajax or endless-pagination. Code in my views.py is following def listing(request): news_list = NewPost.objects.all() paginator = Paginator(news_list, 2) page = request.GET.get('page') try:

Re: VIdeo Lectures ?

2014-10-06 Thread carlos
i thing this good places for learn django http://gettingstartedwithdjango.com/ Cheers On Mon, Oct 6, 2014 at 8:29 AM, Julo wrote: > Godjango.com !! > Really cool videos! > -- > *From: * rishabh yadav > *Sender: * django-users@googlegroups.com > *Date: *Mon, 6 Oct 20

Re: help with idea

2014-10-06 Thread carlos
Collin thank so much really help me! Cheers On Sat, Oct 4, 2014 at 11:09 AM, Collin Anderson wrote: > If you change how your dictionary is formatted, it can be much easier: > dicc_one = { > 'string1': {'fieldsFK__total_one__gt': 0}, > 'string2': {'fieldsFK__total_two__gt': 0}, > 'st

Re: Override runserver django 1.7

2014-10-06 Thread Collin Anderson
It's because the staticfiles app is already overriding the built in runserver command, and it's competing with your app. I think it's the only case of a contrib app overriding a built-in command. The migrate command is built-in to django and there are no contrib apps that override it. -- You

Re: Override runserver django 1.7

2014-10-06 Thread Carlos Perche
great, now it is working. but i have still a question, why the position in the installed_apps does not affect the migrate command and affect the runserver command ? thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from th

Re: Deployment

2014-10-06 Thread Collin Anderson
Yes, nginx is great for serving files, but apache can do it to: https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#serving-files -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Override runserver django 1.7

2014-10-06 Thread Collin Anderson
try putting the staticfiles app below saas in your INSTALLED_APPS -- 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 p

Re: Deployment

2014-10-06 Thread monoBOT
Apache does serve media files if you are able to configure it 2014-10-06 13:45 GMT+01:00 Ling Lung : > I'm trying to deploy my django project in my hosting but its not serve > media files, is an apache server, it seems I have to install nginx or other > like this. Can you tell me which hosting pr

Override runserver django 1.7

2014-10-06 Thread Carlos Perche
Hello, why not is possible override the command runserver.py in my custom app in Django 1.7, like this # encoding: utf-8 from django.conf import settings from django.core.management.base import CommandError, BaseCommand # from django.contrib.staticfiles.management.commands.runserver import Comma

Re: VIdeo Lectures ?

2014-10-06 Thread Julo
Godjango.com !! Really cool videos! -Original Message- From: rishabh yadav Sender: django-users@googlegroups.com Date: Mon, 6 Oct 2014 07:08:20 To: Reply-To: django-users@googlegroups.com Subject: VIdeo Lectures ? Can anyone of u suggest me any good video tutorials for django ? -- You

VIdeo Lectures ?

2014-10-06 Thread rishabh yadav
Can anyone of u suggest me any good video tutorials for django ? -- 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 po

Deployment

2014-10-06 Thread Ling Lung
I'm trying to deploy my django project in my hosting but its not serve media files, is an apache server, it seems I have to install nginx or other like this. Can you tell me which hosting providers are better for django projects, to avoid this problems? Thanks -- You received this message beca

AppConfig where to execute initialization queries?

2014-10-06 Thread Marc Aymerich
Hi, I have been bitten by unexpected behaviors when running tests because on AppConfig.ready() I was initializing some stuff that depends on DB stored data. Reading the django docs I've found a warning that specifically suggests not to do this [1]. But then I wonder where this kind of initializatio

Bug in update_or_create?

2014-10-06 Thread Ryan Hiebert
On related managers, in particular for my case reverse foreign keys, update_or_create doesn't appear to retain the knowledge of the model from whence it came. Is this an expected behavior, or is it a bug? models.py: from django.db import models class Spam(models.Model): pass class Egg(mo

Re: Cannot import models from utility script

2014-10-06 Thread Erik Cederstrand
Den 06/10/2014 kl. 04.54 skrev Sithembewena Lloyd Dube : > Hi all, > > I am using Django 1.7 and I have a package called 'utilities' next to my app > package like so: > > --> my project > --> my_app > -- __init__.py > -- models.py > --> utilities > -- __init__.py