djangoproject.com tutorial part 3

2014-10-20 Thread Tri Vo
So I am following the tutorial in this site, and copy and the first three codes into my project (polls/views.py, polls/urls.py, and mysite/urls/py) https://docs.djangoproject.com/en/1.7/intro/tutorial03/ polls/views.py from django.http import HttpResponse def index(request): return HttpResp

Django builds incorrect sql-query

2014-10-20 Thread Алексей Широков
Hi, I have 2 models: @python_2_unicode_compatible class Document(models.Model): uuid = models.CharField(max_length=32, editable=False, unique=True) contractor = models.ForeignKey(Contractor) stagcy = models.ForeignKey(StateAgency) type = models.CharField(max_length=25) year =

djangoproject.com tutorial part 3 "Hello, World..." not showing up.

2014-10-20 Thread Tri Vo
I am using this site to learn Django, and at this link https://docs.djangoproject.com/en/1.7/intro/tutorial03/ I created the polls/urls.py, polls/views.py, and mysite/urls.py files as followed in the site, but when I run the site, the site is running OK, but I do not see the "Hello, World..." m

Re: Django builds incorrect sql-query

2014-10-20 Thread Javier Guerra Giraldez
On Mon, Oct 20, 2014 at 1:53 AM, Алексей Широков wrote: > SELECT ... > FROM "document_document" > INNER JOIN "document_sending" ON ("document_document"."id" = > "document_sending"."document_id") > INNER JOIN "document_sending" T4 ON ("document_document"."id" = > T4."document_id") > WHERE ("documen

Re: Django builds incorrect sql-query

2014-10-20 Thread Алексей Широков
Javier, I am unable combine 2 parameters in a single call filter(), because It is built on different levels of code. Is there another solution??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Django builds incorrect sql-query

2014-10-20 Thread Javier Guerra Giraldez
On Mon, Oct 20, 2014 at 3:43 AM, Алексей Широков wrote: > Javier, I am unable combine 2 parameters in a single call filter(), because > It is built on different levels of code. > > Is there another solution??? you can build up a dictionary and expand as parameters on a single filter() call:

Re: Django builds incorrect sql-query

2014-10-20 Thread Алексей Широков
Thank you very much Javier!!! I've thought about it. I will try. -- 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: djangoproject.com tutorial part 3

2014-10-20 Thread Lee
When you say nothing changes, how are you calling the page? And what do you see in your browser - any error message or stack trace or is it just a blank page? Also I assume the below were copied from the tutorial. Can you post the contents of the three files as you typed them in your code? On

Re: Tango with Django - Populated Script

2014-10-20 Thread Andrew Crockett
Solution here: http://stackoverflow.com/questions/19699136/python-django-tangowithdjango-models-and-databases On Wednesday, June 4, 2014 2:01:44 PM UTC+4, Srinivasulu Reddy wrote: > > Hello Folks, >I am learning tangowithdjango book . In chapter 5 while dealing > the Populated Script

Re: View didn't return an HttpResponse object

2014-10-20 Thread Dariusz Mysior
Now I try change this part of code in views.py #request.user.set_password(form.cleaned_data['password2']) #request.user.save() #return render(request, 'registration/change_password_success.html', {'user': request.user}) On from django.contrib.auth import logout,

Paginating 31 forms in to multiple pages( 16 forms per page)

2014-10-20 Thread wangolo joel
I have a lot of form(31) am looking for a way to divide them into multiple pages but current I seem not to find any way of doing this. All the other pagination methods seem to favour those displaying data not those displaying forms. Am using class based view(View) DataInputProcessor(View):

How do I use a django join to select customer_name for every id that is returned in a result from a summary table?

2014-10-20 Thread G Z
I've been looking into django joins, and I can see how I can select related fields with .select_related but I can't seem to get it to work how I want. I basically have summary tables that are linked to the customers table with customer_id FK's, I want to select the customer name from the custome

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-20 Thread Carl Meyer
Hi Ken, On 10/18/2014 12:55 PM, Ken Winter wrote: > OK, I've written and unit-tested the database components - see > https://drive.google.com/file/d/0B-thboqjuKZTSjRHTXhqMlo3RlU/view?usp=sharing. > > Now I could use a little advice on the Django part. > > I believe that all that is needed is to

Re: Debugging local Django app outside server root

2014-10-20 Thread Elliott
Update: The django app and the django server are both using the same Python interpreter. If I try to set a breakpoint in the app, the breakpoint does not exist warning actually is a local file but is in the remote_sources cache: Connected to pydev debugger (build 135.1057) pydev debugger: warn

Re: Customize admin page title (from tutorial)

2014-10-20 Thread Carl Meyer
Hi Pat, On 10/18/2014 03:47 PM, Pat Claffey wrote: > Hi, > yes this is possible. I have recently done this tutorial and succeeded > in customizing the title. > In my opinion the instructions in this part of the tutorial are hard to > understand. Here is what I did: > > 1.0 Navigate to the proj

robots.txt 404 errors are not ignored, even though I put it in my settings file

2014-10-20 Thread Sabine Maennel
*Please can anybody help me with 404 errors?* *I put this in my settingsfile: * import re IGNORABLE_404_URLS = ( re.compile(r'^/apple-touch-icon.*\.png$'), re.compile(r'^/favicon\.ico$'), re.compile(r'^/robots\.txt$'), ) *but I still get 404 errors reported for robots.txt: What am

Re: django.views.decorators.http.condition decorator

2014-10-20 Thread Anton Novosyolov
Opened, https://code.djangoproject.com/ticket/23695 -- 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 gr

Re: Getting started with django templatetags

2014-10-20 Thread Collin Anderson
Hello, If you didn't say "can't modify models", I would for sure recommend custom methods on each model. Otherwise, I think Thomas's suggestion is right. Thanks, Collin -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: View didn't return an HttpResponse object

2014-10-20 Thread Collin Anderson
Hello, from django.contrib.auth import logout,login,authenticate,password_change I think you want: from django.contrib.auth import logout,login,authenticate from django.contrib.auth.views import change_password Collin -- You received this message because you are subscribed to the Google Groups

Re: Paginating 31 forms in to multiple pages( 16 forms per page)

2014-10-20 Thread Collin Anderson
Hi, Are you using model formsets? Would something like this might work? page = Paginate(queryset, 16).page(request.GET.get('page') or 1) formset = MyFormSet(queryset=page.object_list) Collin -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: djangoproject.com tutorial part 3

2014-10-20 Thread Tri Vo
I am calling the page with "python manage.py runserver 0.0.0.0:8000" When I load up the page before adding the views and urls files, I see the polls and everything that I have set up with the codes from the previous pages of the tutorial. After adding the views and urls files, the page looks th

Re: robots.txt 404 errors are not ignored, even though I put it in my settings file

2014-10-20 Thread Collin Anderson
Hi Sabine, IGNORABLE_404_URLS = ( re.compile(r'^/apple-touch-icon.*\.png$'), re.compile(r'^/favicon\.ico$'), re.compile(r'^/robots\.txt$'), ) remove the slash at the beginning: IGNORABLE_404_URLS = ( re.compile(r'^apple-touch-icon.*\.png$'), re.compile(r'^favicon\.ico$'), r

Re: OSQA multi language tutorial

2014-10-20 Thread Collin Anderson
Hello, You're probably looking for this page. https://docs.djangoproject.com/en/1.4/topics/i18n/translation/ Collin -- 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

Specifying modelform meta field as get_user_model() in 1.7

2014-10-20 Thread Derek Leverenz
Hi, I'm working on porting our codebase to django 1.7, and we use a custom user model. For that, we need to override the user creation and password reset forms. For the form's Meta class, we have class Meta: model = get_user_model() where get_user_model is imported form django.contrib.au

dropdown_filter in django

2014-10-20 Thread Sachin Tiwari
Hi, I want to make my custom filter into drop down filter, class PersonIdFilter(SimpleListFilter): title = _('Personid') parameter_name ='personid' contlist = list(PersonInfo.objects.all()) def lookups(self, request, model_admin): lst = [] for id in self.contlist

Re: how to query max count

2014-10-20 Thread dk
ok that max(the_max) didn't work every time it provide a different result (looking into this) just updating the post in case someone was looking into this as a solution. On Thursday, October 16, 2014 12:21:33 AM UTC-5, dk wrote: > > looks like it works like this > > the_max = Choice.objects.fil

Using ModelForm with ID associated with PostgreSQL Sequence

2014-10-20 Thread Néstor Boscán
Hi I have an existing PostgreSQL database where all tables have sequences associated to their primary key and no, I can't change it. When I create a ModelForm it generates "Required field" for the ID field because it doesn't have any data. Any ideas how to manage this situation? Regards, Nés