Re: Need "edit" and "delete" buttons on each line of a rendered table

2012-01-16 Thread Bill Beal
Thanks, now I don't have to do the hard work as a noob.

On Mon, Jan 16, 2012 at 9:23 AM, j_syk  wrote:

> This a good application for named urls with passing arguments.
>
> for example, given a urls.py containing
>
>url(r'^edit/(?P[0-9]+)/$', edit_item, name="edit_item"),
>
> in your template you can do this:
>
> {% for item in item_query %}
> 
>Edit
> 
> {% endfor %}
>
> Hope that helps! Named urls are the preferred DRY method too and so
> easy to use!
>
>
> On Jan 16, 8:04 am, Bill Beal  wrote:
> > Thanks, I'll try that.
> >
> > On Mon, Jan 16, 2012 at 8:58 AM, Szabo, Patrick (LNG-VIE) <
> >
> >
> >
> >
> >
> >
> >
> > patrick.sz...@lexisnexis.at> wrote:
> > > Hi,
> >
> > > I'm doing the exact same thing. What i do is i add the id of the
> object of
> > > a row to the url that the button is linking to.
> > > Then I use urls.py and views.py to identify that id and delete or add
> the
> > > object.
> >
> > > cheers
> >
> > > . . . . . . . . . . . . . . . . . . . . . . . . . .
> > > Ing. Patrick Szabo
> > >  XSLT Developer
> > > LexisNexis
> > > A-1030 Wien, Marxergasse 25
> >
> > > mailto:patrick.sz...@lexisnexis.at
> > > Tel.: 00431 534521573
> > > Fax: +43 1 534 52 146
> >
> > > -Ursprüngliche Nachricht-
> >
> > > Von: django-users@googlegroups.com [mailto:
> django-users@googlegroups.com]
> > > Im Auftrag von Bill Beal
> > > Gesendet: Montag, 16. Jänner 2012 14:55
> > > An: Django users
> > > Betreff: Need "edit" and "delete" buttons on each line of a rendered
> table
> >
> > > Hi All,
> >
> > > I'm trying to render a table and have an EDIT
> > > button and a DELETE button on each line, like:
> >
> > > ID numberID typeEDITDELETE
> >
> > > and identify which line is to be EDITed
> > > or DELETEd.  I tried to create a unique name
> > > for each button, like:
> >
> > >  > > value="EDIT" />
> >
> > > but the template language won't let me add.
> > > Is there a simpler way to know which line
> > > the submit came from, that works?
> > > Or even a complicated way that works?
> >
> > > Bill Beal
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Need "edit" and "delete" buttons on each line of a rendered table

2012-01-16 Thread j_syk
This a good application for named urls with passing arguments.

for example, given a urls.py containing

url(r'^edit/(?P[0-9]+)/$', edit_item, name="edit_item"),

in your template you can do this:

{% for item in item_query %}

Edit

{% endfor %}

Hope that helps! Named urls are the preferred DRY method too and so
easy to use!


On Jan 16, 8:04 am, Bill Beal  wrote:
> Thanks, I'll try that.
>
> On Mon, Jan 16, 2012 at 8:58 AM, Szabo, Patrick (LNG-VIE) <
>
>
>
>
>
>
>
> patrick.sz...@lexisnexis.at> wrote:
> > Hi,
>
> > I'm doing the exact same thing. What i do is i add the id of the object of
> > a row to the url that the button is linking to.
> > Then I use urls.py and views.py to identify that id and delete or add the
> > object.
>
> > cheers
>
> > . . . . . . . . . . . . . . . . . . . . . . . . . .
> > Ing. Patrick Szabo
> >  XSLT Developer
> > LexisNexis
> > A-1030 Wien, Marxergasse 25
>
> > mailto:patrick.sz...@lexisnexis.at
> > Tel.: 00431 534521573
> > Fax: +43 1 534 52 146
>
> > -Ursprüngliche Nachricht-
>
> > Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> > Im Auftrag von Bill Beal
> > Gesendet: Montag, 16. Jänner 2012 14:55
> > An: Django users
> > Betreff: Need "edit" and "delete" buttons on each line of a rendered table
>
> > Hi All,
>
> > I'm trying to render a table and have an EDIT
> > button and a DELETE button on each line, like:
>
> > ID number    ID type    EDIT    DELETE
>
> > and identify which line is to be EDITed
> > or DELETEd.  I tried to create a unique name
> > for each button, like:
>
> >  > value="EDIT" />
>
> > but the template language won't let me add.
> > Is there a simpler way to know which line
> > the submit came from, that works?
> > Or even a complicated way that works?
>
> > Bill Beal
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Need "edit" and "delete" buttons on each line of a rendered table

2012-01-16 Thread Bill Beal
Thanks, I'll try that.

On Mon, Jan 16, 2012 at 8:58 AM, Szabo, Patrick (LNG-VIE) <
patrick.sz...@lexisnexis.at> wrote:

> Hi,
>
> I'm doing the exact same thing. What i do is i add the id of the object of
> a row to the url that the button is linking to.
> Then I use urls.py and views.py to identify that id and delete or add the
> object.
>
> cheers
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Ing. Patrick Szabo
>  XSLT Developer
> LexisNexis
> A-1030 Wien, Marxergasse 25
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: 00431 534521573
> Fax: +43 1 534 52 146
>
>
> -Ursprüngliche Nachricht-
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> Im Auftrag von Bill Beal
> Gesendet: Montag, 16. Jänner 2012 14:55
> An: Django users
> Betreff: Need "edit" and "delete" buttons on each line of a rendered table
>
> Hi All,
>
> I'm trying to render a table and have an EDIT
> button and a DELETE button on each line, like:
>
> ID numberID typeEDITDELETE
>
> and identify which line is to be EDITed
> or DELETEd.  I tried to create a unique name
> for each button, like:
>
>  value="EDIT" />
>
> but the template language won't let me add.
> Is there a simpler way to know which line
> the submit came from, that works?
> Or even a complicated way that works?
>
> Bill Beal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.