Re: Django Tutorials

2013-10-27 Thread Diogene Laerce


I find it nice. A table of contents with links to each articles would be 
great. ;)




On 10/28/2013 01:50 AM, Mario Osorio wrote:

From a noob:
I did not have a chance to read a lot, but I must agree with Pepsodent 
Cola: typography IS TERRIBLE to say the least, then again that might 
be the reason I could not read a lot ...


OTOH ... why not use a decent CMS to talk about django? How about 
starting your blog on django using pythonanywhere.com's free service, 
for example?


You seem to have some good articles, but you should at the very least 
revise your typography.


On Saturday, October 26, 2013 9:05:13 AM UTC-4, Jasvir Singh wrote:

I have started a series of Django tutorial for beginners. I am making
them in such a way that a user get knowledge for working on Django in
quick and efficient way.
Till now, I have completed only introduction phase.

I'll also make video tutorials for the same exercises.

Here is link of my tutorials
http://goo.gl/3jPaf7

Please review it. I need your suggestions to make them more
efficient.

-- 
Jasvir Singh Grewal

Blog: jasvirsinghgrewal91.wordpress.com


:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : To randomly play mp3 songs from a directory LOST #243

mpg123 -z /path/to/mp3s/*.mp3
This will randomly play mp3 songs from the specified folder.

[ajitabhpandey (at) users.sourceforge.net
]
:

--
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/13c0a384-5da6-402e-94a1-ccc9b56b732b%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
“One original thought is worth a thousand mindless quotings.”
“Le vrai n'est pas plus sûr que le probable.”

  Diogene Laerce

--
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/526DF6BD.7080201%40yahoo.fr.
For more options, visit https://groups.google.com/groups/opt_out.


Multiple Signup forms

2013-10-27 Thread Franco Alarcon
Greetings everyone,
  I know that maybe this is not the best place to ask, but I already asked 
in the django-alluth forum without luck, so here I'm.
  I'm developing an application in which exists two kind of user and I have 
to show a different singup form for each one. The first thing that I 
thought was subclass the SignupView and replace the SignupForm with my 
custom form, then in the urls.py create 2 urls where each one points 
towards my custom SingupViews and it's done. Sadly i couldn't be more 
wrong, because when the user is not logged in it is redirected to 
/accounts/login the to the provider, for instance facebook and then back to 
/accounts/signup/ and not to my SignupView. I tried changing the "next" url 
parameter without luck. So anybody knows how i could have two different 
signup forms one for each kind of user?

Thanks in advance ;)

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d83553e2-b514-4568-b8ef-722912042591%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Duplicating production data for specific TestCase

2013-10-27 Thread Burak Emre Kabakcı
I need an actual data created by users in my special TestCase class. Django 
automatically create another database and execute syndb command which loads 
data into multiple tables (contenttypes, auth_permissions etc.) and 
fixtures and when I try to import my dump in setUp() method, it conflicts 
with the initial data.
I took a look at default DjangoTestSuiteRunner class but overriding this 
class in my settings doesn't seem like a good idea because it also uses 
different functions from different files for creating files 
(django.db.backends) and when I override DjangoTestSuiteRunner 
create_test_db method, it may cause problems for other TestCases in my 
project.

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dbb955dc-3a1a-4f81-91b0-307b1357cf90%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Psycopg2 on Mac OS X (Snow Leopard)

2013-10-27 Thread Skip Montanaro
Thanks for the response. I only mentioned MacPorts to demonstrate that when 
psycopg2 was built, pip couldn't have found libssl 1.x there. I routinely build 
my own Python instances. The venv version of Python is a 2.7.5+ version built 
from hg.

Skip

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/505b99cf-f371-46f9-b12b-ea4fcc71445a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django ManyToMany performance?

2013-10-27 Thread Robin St.Clair
First of all , any DBMS that is misused by design or in operation will give 
poor performance.. There is an excellent mature database available for 
Django developers, PostgreSQL. It works fine on the same machine as you are 
developing on.

MongoDB is NOT a suitable DB for general purposes. It is fine for 
documents, less good for being updated, particularly as it locks tables 
when updating or inserting.

Make sure your generated database is checked by somebody who knows about 
databases.

R+C

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6007019b-b007-4d46-adab-4dcbf16b0e7d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django ManyToMany performance?

2013-10-27 Thread Daniel Roseman
On Sunday, 27 October 2013 00:46:17 UTC+1, Ruturaj Dhekane wrote:

> Hi all,
>
> I have a particular datastructure where there are two objects
> 1. A document - and a lot of its properties - like content, version, 
> timestamp etc.
> 2. Contributors - basically people represented by unique IDs
>
> A document can have many contributors and a contributor can author many 
> documents. A typical manyTomany scenario
>
> Is there a design where I can find how ManyToMany is implemented (I know I 
> can go through the code - but existing design document/wiki/blog might 
> help).
>
> Also what are the performance implications? 
> How many SQL queries does it really make per request on django? 
> Can it scale to say 1million documents and a few thousand users?
> What is a good SQL backend I can use? MYSQL or SQLite?
> Has anyone tried with MondoDB etc for such relationships?
> Any examples where you have used ManyToMany and scaled it up for many 
> entries?
>
> Thank you for your answers. Would give me a lot of confidence in going 
> ahead with choosing M2M as a field. The whole project might hinge on it!
>
> Ruturaj
>
>
This question is a bit too vague to answer. A many-to-many relationship in 
a Django database is implemented just as it would be in any other SQL db - 
with an intermediate linking table containing foreign keys to both sides of 
the relationship - and queried via JOINs between the three tables. The only 
difference is that the linking table isn't exposed unless you specifically 
ask it to be.

There's nothing specifically efficient or inefficient about the m2m field: 
it just is what it is. If it fits your data model - which, given your 
description, I'd say it does - you should use it.
--
DR.

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bfaef3b6-6fb6-473a-80d2-b1730884ebfd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Tutorials

2013-10-27 Thread Mario Osorio
>From a noob:
I did not have a chance to read a lot, but I must agree with Pepsodent 
Cola: typography IS TERRIBLE to say the least, then again that might be the 
reason I could not read a lot ...

OTOH ... why not use a decent CMS to talk about django? How about starting 
your blog on django using pythonanywhere.com's free service, for example?

You seem to have some good articles, but you should at the very least 
revise your typography.

On Saturday, October 26, 2013 9:05:13 AM UTC-4, Jasvir Singh wrote:
>
> I have started a series of Django tutorial for beginners. I am making 
> them in such a way that a user get knowledge for working on Django in 
> quick and efficient way. 
> Till now, I have completed only introduction phase. 
>
> I'll also make video tutorials for the same exercises. 
>
> Here is link of my tutorials 
> http://goo.gl/3jPaf7 
>
> Please review it. I need your suggestions to make them more efficient. 
>
> -- 
> Jasvir Singh Grewal 
> Blog: jasvirsinghgrewal91.wordpress.com 
>
> : 
> [ GNU/Linux One Stanza Tip (LOST) ]### 
>   
> Sub : To randomly play mp3 songs from a directoryLOST #243 
>
> mpg123 -z /path/to/mp3s/*.mp3 
> This will randomly play mp3 songs from the specified folder. 
>   
> [ajitabhpandey (at) users.sourceforge.net] 
> : 
>

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/13c0a384-5da6-402e-94a1-ccc9b56b732b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django doesn't close connections to Oracle database.

2013-10-27 Thread Igor Dakić
Hi everyone, 
I'm hosting django (1.4) app via httpd (apache - 2.2.21) and mod_wsgi (3.3.1) 
on fedora 15 and having problem with Oracle, which blocks further connections 
after limit is reached. I know Django connects to a db for every query, which 
will be changed in 1.6 with persistent connections, but it doesn't close 
connection after getting result, yet leave it open and inactive. That's not the 
case with django development server, which handle those connections properly.
Anyone have idea where the problem is?

Thanks in advance,
Igor.

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/79dff051-0fb5-491c-b402-a0d533ba3fa8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-10-27 Thread Patti Chen
Hi Jimmy,

Could you please check your urls.py?
You need to pass category_name_url in url mapping. Read
this
section
in the book and check
this
.




On Sun, Oct 27, 2013 at 5:01 PM, Jimmy Pants  wrote:

> Hey yall
>
> Here is my current views.py:
>
> http://pastebin.mozilla.org/3361332
>
> PROBLEM:
>
> I'm trying to add an "Add Page" form to the project, per the tutorial at
> this step:
>
>
> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
>
> When I click on "Add Page" in a category view, I get
>
> TypeError at /rango/add_page/
>
> add_page() takes exactly 2 arguments (1 given)
>
>
> THOUGHTS:
>
> So far as I can tell, line 60 adds category_name_url to context_dict,
> which means that category_name_url should go into the context that gets
> passed on.. or else I am seriously failing to grasp this, which is the more
> likely idea. I'm pretty sure I can't just add another argument to the
> render_to_response, so the only other option I can think of is to put a
> dictionary in the render_to_response, which includes category_name_url...
> BUT I don't know what all else is in the context_dict at that point.
>
> been fiddling with this for a couple hours now, seemingly getting nowhere.
> I based my current code on the stuff 
> here
> .
>
> --
> 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 group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/97806597-f43d-4184-9ec5-736897967324%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN1WgRLQ3hsCH2b9a2yY%2BS0xKcQs4x_OquJk6aeJv4d43dPV1A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Bulk add foreign keys in admin interface

2013-10-27 Thread Kristofer Pettijohn
I found that previously, but it doesn't seem to be quite what I need.

Let me try to rephrase.  I want to add two multi-selection boxes within the 
admin view page for the Product model.  One of the multi-selections will be 
for Colors, and one will be for Sizes.  I then want a button that the user 
can click after the select options from both multi-selection boxes.  The 
button will redirect to a method that will loop through the product of the 
two selections and add a Variation for each combination to the single 
Product (not multiple products).

For example, if the user wants to add Green, Yellow, Blue, Pink, Orange, 
and White colors with sizes 2, 4, 6, 8, 10, and 12, they can do it all with 
one click, versus manually adding 32 (Green-2, Green-4, Green-6, Blue-2, 
Blue-4, Blue-6, etc.) items into the TabularInline section

On Saturday, October 26, 2013 5:17:47 AM UTC-5, Timothy W. Cook wrote:
>
> Yes it is possible and quite easy to do.  Take a look at 
> https://docs.djangoproject.com/en/1.6/ref/contrib/admin/actions/
>
> Cheers,
> Tim
>
>
> On Sat, Oct 26, 2013 at 12:17 AM, Kristofer Pettijohn <
> kris...@cybernetik.net > wrote:
>
>> I am using the following type of model setup:
>>
>> class Product(models.Model):
>> name = models.CharField(max_length=40)
>> description = models.TextField(blank=True)
>> active = models.BooleanField(default=True)
>> priority = models.IntegerField(default=100)
>> size_chart = models.ForeignKey(SizeChart)
>> designer = models.ForeignKey(Designer)
>> collections = models.ManyToManyField(Collection)
>> categories = models.ManyToManyField(Category)
>> price = models.DecimalField(max_digits=6, decimal_places=2)
>> def __unicode__(self):
>> return self.name
>>
>> class Variation(models.Model):
>> color = models.ForeignKey(Color)
>> size = models.ForeignKey(Size)
>> product = models.ForeignKey(Product)
>> price_override = models.DecimalField(max_digits=6, decimal_places=2, 
>> blank=True)
>>
>> I have Variations setup as TabularInline in Django admin.  However, there 
>> are > 200 different colors, and about 20 sizes.  Adding 10 different colors 
>> with 15 sizes is a lot of clicking for someone.  What I would like to do is 
>> add some type of dropdown where multiple colors, along with multiple Sizes, 
>> can be selected, and then all of the Variations will be created for the 
>> cross product of those two selections.
>>
>> What I envision is having an area somewhere in the Django Admin for 
>> Product that is titled "Bulk Add" with drop down boxes for both Color and 
>> Size where multiple values for each can be selected.  When the user is 
>> happy with their selection, they will click a button and all of the 
>> Variations will be created and the user will be back to the product page 
>> with all of the options now visible in the TabularInline section.
>>
>> Is this type of action possible?
>>
>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/1899431826.178951.1382753821780.JavaMail.zimbra%40cybernetik.net
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>  

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b9f05437-8f26-4481-98ee-12c1bc6641fa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


I have a question with "ModelForm"

2013-10-27 Thread Jonathan Espinal
I have a question with "ModelForm", I have a accounts model with a 
foreignkey on users model, when I try to save a record using "ModelForm", 
the SQL "debug_toolbar" show my 2 aditionals query:

"SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", 
"auth_user"."is_superuser", "auth_user"."username", 
"auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", 
"auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" 
FROM "auth_user" WHERE "auth_user"."id" = 1"

and

"SELECT (1) AS "a" FROM "auth_user" WHERE "auth_user"."id" = 1 LIMIT 1"

Could I avoid that, or what am i doing wrong ?

Thanks...

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f793e8c5-11db-4f2a-9e97-a16abc51c5ae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Psycopg2 on Mac OS X (Snow Leopard)

2013-10-27 Thread Doug Snyder
I don't have a very specific answer for your question. I just started doing
my django dev on OSX coming from Ubuntu
My understanding is that Home Brew is a better solution than Mac Ports, I
have heard some people being very critical of Mac Ports which I think was
once the best solution for python environments on OSX but I think has been
mostly replaced by Home Brew. Switching over may solve your problem
automatically and may make life easier down the road too. But maybe someone
else will have a more knowledgable, specific answer to your specific
problem.
Another solution that doesn't require and headaches is that Mavericks, the
new OSX release may still be free for download. They announced it was free
but the way they worded it made it sound like it may have only been free
for the day it came out. Not sure if that's a road you want to go down or
not.
Good Luck,
Doug


On Sun, Oct 27, 2013 at 10:20 AM, Skip Montanaro
wrote:

> I'm working my way through my first non-tutorial Django project. I
> plan to deploy it (at least initially) on Heroku. I'm at the point
> where I have my basic structure laid out and am proceeding to model
> definition. Heroku's default database is PostgreSQL, which I'm
> comfortable with, and seems to be installed properly there. The
> locally built psycopg2 module (2.5.1) is missing libssl, however:
>
> (venv)topten% python manage.py shell
> ImportError:
> dlopen(/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so,
> 2): Library not loaded: libssl.1.0.0.dylib
>   Referenced from:
>
> /Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so
>   Reason: image not found
>
> Looking on my Mac running Snow Leopard (10.6.8), I only see 0.9.x
> versions of libssl in /usr/lib. I have no libssl in my MacPorts
> directory (/opt/local/lib).
>
> Where did whatever built psycopg2 (pip?) get the idea that I had
> libssl 1.0? More importantly, how can I get past this bump in the
> road?
>
> Thanks,
>
> Skip Montanaro
>
> --
> 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 group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANc-5UwY67Yh%3DoJJO%3D2TjOighTOK8xiviQz4oei3NS4oEVdK%3Dw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAo39dYUP87S4uJuHA0gd13EaPReMo7mGHZ3jtWwemFRSFFBpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-10-27 Thread J. Paskaruk
Thank you! My thinking was all muddled, and that at least got me moved on
to a new error at least - I never lose heart, as long as I'm generating new
and revealing forms of errors, but I even my errors had stalled at that
point. Anyways, I just got it done. Cheers :>


On Sun, Oct 27, 2013 at 7:20 AM, Patti Chen  wrote:

> Hi Jimmy,
>
> Could you please check your urls.py?
> You need to pass category_name_url in url mapping. Read 
> this
>  section
> in the book and check 
> this
> .
>
>
>
>
> On Sun, Oct 27, 2013 at 5:01 PM, Jimmy Pants  wrote:
>
>> Hey yall
>>
>> Here is my current views.py:
>>
>> http://pastebin.mozilla.org/3361332
>>
>> PROBLEM:
>>
>> I'm trying to add an "Add Page" form to the project, per the tutorial at
>> this step:
>>
>>
>> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
>>
>> When I click on "Add Page" in a category view, I get
>>
>> TypeError at /rango/add_page/
>>
>> add_page() takes exactly 2 arguments (1 given)
>>
>>
>> THOUGHTS:
>>
>> So far as I can tell, line 60 adds category_name_url to context_dict,
>> which means that category_name_url should go into the context that gets
>> passed on.. or else I am seriously failing to grasp this, which is the more
>> likely idea. I'm pretty sure I can't just add another argument to the
>> render_to_response, so the only other option I can think of is to put a
>> dictionary in the render_to_response, which includes category_name_url...
>> BUT I don't know what all else is in the context_dict at that point.
>>
>> been fiddling with this for a couple hours now, seemingly getting
>> nowhere. I based my current code on the stuff 
>> here
>> .
>>
>> --
>> 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 group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/97806597-f43d-4184-9ec5-736897967324%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANabDdLj2TCx%2BuuEfXsJExRw1i3vi_ZW0pTfB8wjX0QzgiSuXw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Tango with Django tutorial, problem getting category function to pass a variable

2013-10-27 Thread Jimmy Pants
Hey yall

Here is my current views.py:

http://pastebin.mozilla.org/3361332

PROBLEM:

I'm trying to add an "Add Page" form to the project, per the tutorial at 
this step:

http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping

When I click on "Add Page" in a category view, I get

TypeError at /rango/add_page/ 

add_page() takes exactly 2 arguments (1 given)


THOUGHTS:

So far as I can tell, line 60 adds category_name_url to context_dict, which 
means that category_name_url should go into the context that gets passed 
on.. or else I am seriously failing to grasp this, which is the more likely 
idea. I'm pretty sure I can't just add another argument to the 
render_to_response, so the only other option I can think of is to put a 
dictionary in the render_to_response, which includes category_name_url... 
BUT I don't know what all else is in the context_dict at that point. 

been fiddling with this for a couple hours now, seemingly getting nowhere. 
I based my current code on the stuff 
here
.

-- 
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 group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/97806597-f43d-4184-9ec5-736897967324%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.