Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9053825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:31:28+00:00 2026-06-16T13:31:28+00:00

I am trying to create a table that has rows of data that represent

  • 0

I am trying to create a table that has rows of data that represent Contacts – a mix of people and company contacts. I want each row to be “clickable” so that, when clicked, that contact’s form is pulled up for editing. To do that, I have something like this:

<tr onclick="window.location.href='{% url my.django.view %}'">...

You’ll notice that the above has two levels of quotes: a double ” after the equals, then a single ‘ to encapsulate the django template tag. There are two types of contacts: companies and people. I have my urls.py set up to handle this, with the following:

(r'^contact-details/(?P<cType>C)/(?P<cid>N)/$', contact_details),
(r'^contact-details/(?P<cType>P)/(?P<cid>N)/$', contact_details),
(r'^contact-details/(?P<cType>C)/(?P<cid>.*)/$', contact_details),
(r'^contact-details/(?P<cType>P)/(?P<cid>.*)/$', contact_details),

So, with the above, I have two urls for new contacts (distinguished by cType of C=Company or cType of P=Person) then two more urls for existing contacts (using cid for the primary key of the record).

The link imbedded in the rows of the table which list all the contacts looks like this:

<tr onclick="window.location.href='{% url cpm.contacts.views.contact_details 'P' c.pk %}'">

The problem I am having is that I can’t pass in a ‘P’ or a ‘C’ into the link, because it would cause a third level of quotes and, thus, break the quotes all together. I just don’t know how to escape that third level of quotes, around the P or C.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:31:29+00:00Added an answer on June 16, 2026 at 1:31 pm

    You can just use double quotes around the “P”, because the Django {% escape prevents the embedded double quote from closing the quotes for the HTML attribute.

    <tr onclick="window.location.href='{% url cpm.contacts.views.contact_details "P" c.pk %}'">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data.frame and I'm trying to create a frequency table that shows
I am trying to compare two tables to find rows in each table that
I am trying to create a table with values that are in a String
I am trying to figure out how to create a temporary table that is
I'm trying to translate a table RoomType. I create a Texts table that contains:
I am trying to create a template that will put items in a table.
Im trying to create an ajax (post) event that will populate a table in
I'm trying to create a <table> that doesn't exceed a certain width (let's say
I am trying to create a report that pulls data from 2 tables: a
I'm trying to create a basic database trigger that conditionally deletes rows from database1.table1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.