Re: Django: Having trouble with nesting URLS

2014-04-01 Thread Kelvin Wong
You might try this # settings.py INSTALLED_APPS += ('registration',) # urls.py -- In appropriate section url(r'^accounts/', include('registration.backends.simple.urls')), -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Unhandled Exception

2014-04-01 Thread Sami Razi
hi, i'm newbie with django. i'm using pythonanywhere.com for learning/testing django. i made a web page so when i go to aseds.pythonanywhere.com (aseds is my usernamet) i could see my page. then i made an app. but didn't change the view for aseds.pythonanywhere.com now, when i go to

Re: Use custom HTML to render forms

2014-04-01 Thread Mario Gudelj
You can use {{form.field_name}} to render the input tag, {{form.field_name.label}} to render the label and {{form.field_name.errors}} to render field errors. Simple example: {{ reorder_form.comments.label }}

Re: Django python checkbox

2014-04-01 Thread Camilo Torres
Lets suppose you need the user to select which files to download: --choro_checkbox.html Choro's quertion about checkboxes Select files to download {% csrf_token %} File A File B File C File D File E File F Now, you must watch which of the files the user selected, but you have a

Re: Django python checkbox

2014-04-01 Thread Mario Gudelj
There are a few ways in which you can do this. One of them is to add some javascript to your code that will listen to onclick and check if your input button is selected. If it is it will submit the form that initiates your download. You can also do an Ajax post. Another way would be to create a

Re: Django python checkbox

2014-04-01 Thread Choro H
Sorry you all, so,i want to export csv from database that is only when checked 2014年4月1日火曜日 13時22分31秒 UTC+9 Choro H: > > Thank you very much! > I'm Sorry, i'm missing write comments, > I want to do download have been checboxd file from html, then i write to > views.py this code, so i

Re: Why can invalid models be saved?

2014-04-01 Thread Russell Keith-Magee
On Tue, Apr 1, 2014 at 4:19 PM, Claus Conrad wrote: > Hi, > > sorry for the newbie question! > > In the admin I cannot create a user without a username, but on the shell > it is possible: > > >>> from django.contrib.auth.models import User > >>> u = User() > >>> u.save() >

Re: Nesting custom template tags

2014-04-01 Thread Kelvin Wong
You might want to look at the code for making a tag like: URLNode(Node) line 408 of https://github.com/django/django/blob/stable/1.6.x/django/template/defaulttags.py Then extend that. class MyAnchor(URLNode): override the init function to accept the params your are sending and override

Re: ORM Question

2014-04-01 Thread Justin Holmes
You say "use the reverse relation manager in LlamaHerd to build up your annotation," but that answer the question. How can I sort LlamaHerd objects by the DOB of their largest llama? On Tue, Apr 1, 2014 at 6:13 PM, Justin Holmes wrote: > Yes, absolutely - my bad. I

Re: ORM Question

2014-04-01 Thread Justin Holmes
Yes, absolutely - my bad. I have updated to SO question. I meant the models to look like: class LlamaHerd(models.Model): shepherd = ForeignKey(User) class Llama(models.Model): size = FloatField() dob = FloatField herd = ForeignKey(Herd, related_name="llamas") On Tue, Apr 1,

Re: ORM Question

2014-04-01 Thread Bill Freeman
Aren't you missing a ForeignKey relationship to tell which LlamaHerd a Llama belongs to? Then you would use the reverse relation manager in LlamaHerd to build up your annotation. On Tue, Apr 1, 2014 at 5:52 PM, Justin Holmes wrote: > I have come across this problem in

ORM Question

2014-04-01 Thread Justin Holmes
I have come across this problem in several Django projects, but only just now worked it out in my head enough to make it a cognizable question. I have also posted it on StackOverflow, here:

Re: ManyToManyField and Multi Table Inheritance

2014-04-01 Thread Camilo Torres
I tested this with SQLite3 and it worked, using your models: >>> a.users = User.objects.all() >>> a.save() >>> a.delete() >>> a = AccountTypeA(name='') >>> a.save() >>> a.users = User.objects.all() After that: sqlite> select * from testapp_accounttype_users; 1|1|1 Which is what I should

Re: ManyToMany quick question

2014-04-01 Thread willyhakim
Camillo, YOU'RE DA MAN! Thank you so much? One day, at djangocon, I will buy you a beer -- 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

Re: ManyToMany quick question

2014-04-01 Thread Camilo Torres
Hello, By using default table names and default (or automatic) many to many field management, you get a join table like countries_products, but in your case, you are doing the many to many field management through the Imports model, so in the DB you should see data in the imports table for

Re: Filtersets

2014-04-01 Thread C. Kirby
Hi Conrad, I've built a django app to build queries like this. The one that is available on github right now is somewhat specific to my initial use case, but I plan on releasing a new, much more modular version of it this week. If you want to take a look at it and use it, or wait for the

Re: Why can invalid models be saved?

2014-04-01 Thread Bill Freeman
Most validation is in the processing of HTML forms, to help the site user (or admin) avoid errors. Checking on the way to the database is much more limited, and is usually limited to the ability to coerce the field to the correct type. Since django works with many databases, there is very little

Why can invalid models be saved?

2014-04-01 Thread Claus Conrad
Hi, sorry for the newbie question! In the admin I cannot create a user without a username, but on the shell it is possible: >>> from django.contrib.auth.models import User >>> u = User() >>> u.save() >>> u.id 2 I am trying to understand why this is possible. Does this mean model constraints

ManyToManyField and Multi Table Inheritance

2014-04-01 Thread Izidor Matušov
Hi, I've run into interesting issue and I'm not sure if I do something wrong or this is Django issue. I'm using Multi Table Inheritance: from django.db import models from django import forms class AccountType(models.Model): users = models.ManyToManyField('auth.User',

Re: Logging into django admin site via wget and/or wkhtmltopdf

2014-04-01 Thread Anil Arya
same error is coming .Have u solved this problem On Thursday, March 4, 2010 4:17:48 PM UTC+5:30, Emma F wrote: > > Has anyone ever had any success accessing the django admin site via > either of these tools? > > I'm working on a view that will convert a particular dynamically- > generated

Filtersets

2014-04-01 Thread Conrad Rowlands
Hi All. I wonder if anyone can point me in the right direction. I am building a web api using django and FilterSets and wish to allow consumers to perform a query along the lines of Manufacturer =x OR manufacturer = y etc etc Is this achievable out of the box and how would you specify this

Re: ManyToMany quick question

2014-04-01 Thread willyhakim
I think I was missing the concept all together. So the m2m field is just there to show the relationship but does not take any data. That is why when I look in pgadmin, I do not see it. So sorry, I was missing the concept all together. -- You received this message because you are subscribed

Re: ManyToMany quick question

2014-04-01 Thread antialiasis
I don't know why you're calling a ManyToManyField to Products a country name, but you shouldn't get a country_name field - the Imports table will contain all the data needed to associate countries with products. What exactly do you want to be stored in the country_name field on the Countries

Re: Use custom HTML to render forms

2014-04-01 Thread Mike Dewhirst
On 1/04/2014 8:12 PM, Daniel Roseman wrote: On Tuesday, 1 April 2014 00:40:44 UTC+1, Fred DJar wrote: HELP PLEASE I agree with DR but it might be interesting to know what your problem might be ... No. You don't get to demand that people help you. If someone knows the answer to your

Re: ManyToMany quick question

2014-04-01 Thread willyhakim
Below is my models.py My problem is when I syncdb (I have dropped the db couple times to start over) the *country_name* field with m2m never shows in the db. what am I doing wrong? I am using postgres class Products(models.Model): hs_number = models.CharField(primary_key=True, blank=True,

Re: Django apps

2014-04-01 Thread Lee
Start here and follow the tutorial: https://docs.djangoproject.com/en/1.6/intro/tutorial01/ Then you may want to run through this if you are interested in the goe stuff: https://docs.djangoproject.com/en/1.6/ref/contrib/gis/tutorial/ That should give you a good idea on where to start with

Re: Use custom HTML to render forms

2014-04-01 Thread Daniel Roseman
On Tuesday, 1 April 2014 00:40:44 UTC+1, Fred DJar wrote: > > HELP PLEASE > No. You don't get to demand that people help you. If someone knows the answer to your question, and they have time to answer - and if they can work out what you're asking, which isn't obvious - they will reply. But if