Re: Tree view me

2010-05-14 Thread Peter Herndon

On May 14, 2010, at 4:16 AM, cyrux cyrux wrote:

> I have a simple task to accomplish. I have some hierarchal data in my
> database which needs to be displayed in a UI. It needs to be simple
> and preferably in a expandable tree format (although a non -expandable
> should work as well). This is what I am looking for
> http://source.mihelac.org/x/treetable/tests/example2.html#
> 
> I have been looking django since last week and I haven't gone
> anywhere. I have looked at a couple of extensions , but I am not sure
> if they would work. So , is it possible to achieve some thing like the
> above link in django ? I have looked into django-mptt and django-
> treemneu but seems consuing. I have never really worked on front end
> languages like HTML , PHP , so the template part of django confuses
> me. There is so much of stuff happening behind the scenese that
> confuses me. If somebody can tell me if this is possible, i can spend
> may be a day or more looking into it, else I will probably go for php
> stuff

Django is front-end agnostic.  There may be individual reusable apps that 
provide what you need, but Django itself does not come with a tree view, nor 
does it pick a particular JavaScript library to integrate.  This means you have 
all the flexibility you may need to build whatever components your application 
requires.  This also means you often have the burden of developing the 
front-end by yourself.

In my case, I have had good results incorporating the jQuery Dynatree plugin 
into my application.  However, I did the integration entirely myself.

If you only have "a day or more" to invest on building the front-end, and you 
are not comfortable building HTML and wiring up JavaScript, but you *are* 
comfortable with PHP, then PHP may be the better choice for your needs.  On the 
other hand, if you continue to build web applications, you will need to develop 
a certain expertise with HTML, CSS and JavaScript, in addition to your 
server-side framework and its language, so you may want to put the time in to 
learn the tools now.

Hope that helps,

---Peter Herndon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Tree view me

2010-05-14 Thread cyrux cyrux
I have a simple task to accomplish. I have some hierarchal data in my
database which needs to be displayed in a UI. It needs to be simple
and preferably in a expandable tree format (although a non -expandable
should work as well). This is what I am looking for
http://source.mihelac.org/x/treetable/tests/example2.html#

I have been looking django since last week and I haven't gone
anywhere. I have looked at a couple of extensions , but I am not sure
if they would work. So , is it possible to achieve some thing like the
above link in django ? I have looked into django-mptt and django-
treemneu but seems consuing. I have never really worked on front end
languages like HTML , PHP , so the template part of django confuses
me. There is so much of stuff happening behind the scenese that
confuses me. If somebody can tell me if this is possible, i can spend
may be a day or more looking into it, else I will probably go for php
stuff

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: formatting queryset for tree view

2008-07-27 Thread Matthias Kestenholz

On Fri, 2008-07-25 at 16:20 +0530, Leppy wrote:
> Hi all, 
> 
> Here I have a model called Product. It has a self relationship as
> shown below.
> 
> class Product(models.Model):
> 
>   name = models.CharField(max_length = 200, blank = True)
> 
>   main_product = models.ForeignKey('self', verbose_name =
> "Subproduct of", help_text = "sl.no. of the containing component",
> blank = True, null = True)
> 
>   sl_no = models.CharField(max_length = 200, verbose_name =
> "Serial No.", blank = True)
> 
>  make_model = models.CharField(max_length = 200, verbose_name =
> "Make & Model", blank = True)
> 
> I have to show these products in a tree view in template. Here
> product-1 can have a subproduct prouduct-2 and product-2 can have a
> subproduct prouduct-3 and so on. Can anyone suggest an efficent way to
> repersent this as a tree (means how the queryset be formatted before
> rendering to template).

I'd suggest taking a look at django-mptt. It solves this problem (and
some more) neatly:

http://code.google.com/p/django-mptt/





--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



formatting queryset for tree view

2008-07-25 Thread Leppy
Hi all,

Here I have a model called Product. It has a self relationship as shown
below.

class Product(models.Model):

  name = models.CharField(max_length = 200, blank = True)

  main_product = models.ForeignKey('self', verbose_name = "Subproduct
of", help_text = "sl.no. of the containing component", blank = True, null =
True)

  sl_no = models.CharField(max_length = 200, verbose_name = "Serial
No.", blank = True)

 make_model = models.CharField(max_length = 200, verbose_name = "Make &
Model", blank = True)

I have to show these products in a tree view in template. Here product-1 can
have a subproduct prouduct-2 and product-2 can have a subproduct prouduct-3
and so on. Can anyone suggest an efficent way to repersent this as a
tree(means how the queryset be formatted before rendering to
template).


Thank in advance.
leppy.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



formatting queryset for tree view

2008-07-25 Thread Leppy
Hi all,

Here I have a model called Product. It has a self relationship as shown
below.

class Product(models.Model):

  name = models.CharField(max_length = 200, blank = True)

  main_product = models.ForeignKey('self', verbose_name = "Subproduct
of", help_text = "sl.no. of the containing component", blank = True, null =
True)

  sl_no = models.CharField(max_length = 200, verbose_name = "Serial
No.", blank = True)

 make_model = models.CharField(max_length = 200, verbose_name = "Make &
Model", blank = True)

I have to show these products in a tree view in template. Here product-1 can
have a subproduct prouduct-2 and product-2 can have a subproduct prouduct-3
and so on. Can anyone suggest an efficent way to repersent this as a tree
(means how the queryset be formatted before rendering to template).


Thank in advance.
leppy.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Displaying a Tree view in template using django-mptt

2008-02-25 Thread Manakel

Hello Dear all,

First let me say that i'm very new in term of web based developpemnt
(the HTML/CSS Part). i've always worked on backend logic (in java,
python, etc) never on the end user interface directly.

This said, i'm trying to use the django-mptt to install a simple
hierarchy in my first django app.
And I'm blocked at the view template / level
(ie rendering something for the end user)

At the model level, the integration is successful.
i've registered my Item model in mptt.
My Item has a 'parent' field that is used by mptt to discover parent/
child relation ship.

So i can create some Item hierarchy in a breezeAnd i can use it on
the python command line.

But i can't figure my self how to integrate this in a template.
What i'm looking for is a way to render the whole item Tree.
Each item would have it's own line with it's title
Each item would be a little more on the right side depending on the
depth in the hiearchy
Each item would have a link on the right to edit himself
Each item would have a link on the right to move himself

So i guess i should use the mptt template tag
{% full_tree_for_model myApp.Item as OneItem %}

But then, how do i display for each OneItem
1) OneItem deppth in the tree
2) OneItem title
3) OneItem pk id (to generate the right link)



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Tree View

2006-02-05 Thread Max Battcher


Julio Nobrega wrote:

  's are possible, it's in fact what I use on my (to-be) site:


  {% for node in node_tree %}
  
{{ node.body }}
  
  {% endfor %}



It's still not semantic (uses presentation style instead of nested 
s).  It's looking like if I really want a true list view I need to 
build a custom tag.  Right now I think I'm just going to spread the tree 
out across the URL space.


--
--Max Battcher--
http://www.worldmaker.net/


Re: Tree View

2006-02-04 Thread Julio Nobrega

  's are possible, it's in fact what I use on my (to-be) site:


  {% for node in node_tree %}
  
{{ node.body }}
  
  {% endfor %}


Screenshot of (a more styleshed) output here:

http://static.flickr.com/42/95381035_a51eb622dc_o.png

On 2/4/06, Max Battcher <[EMAIL PROTECTED]> wrote:
>
> akaihola wrote:
> > See these cookbook recipes for ideas:
> > http://code.djangoproject.com/wiki/CookBookCategoryDataModel
>
> I was using this already.
>
> > http://code.djangoproject.com/wiki/ModifiedPreorderTreeTraversal
>
> Thanks.  That's a start.  I was hoping for something a bit wiser and
> more generic, though...  something to produce nice semantic XHTML
> (s).  I'll ponder on this subject a bit more later.
>
> --
> --Max Battcher--
> http://www.worldmaker.net/
>


--
Julio Nobrega - http://www.inerciasensorial.com.br


Re: Tree View

2006-02-04 Thread akaihola

See these cookbook recipes for ideas:
http://code.djangoproject.com/wiki/CookBookCategoryDataModel
http://code.djangoproject.com/wiki/ModifiedPreorderTreeTraversal

I use a custon template tag to make a tree-like navigation menu by
turning the tree into a straight list with depth information on each
item. My tree structure comes from Flatpages URLs though and not a
recursive model. Anyway I thought it's wise to do all the complex stuff
(be it recursion or otherwise) in Python in the view and have the
template deal with just a straight list.