django-mptt

2008-09-04 Thread peter_g


Hi!

Playing with the wonderful mptt code:
http://code.google.com/p/django-mptt/

I would like to ask if someone knows how to do this:
(I play with some kind of navigation for websites)

I have a tree where some nodes are marked "inactive"
or "deleted". Furthermore, some nodes are to be
displayed in different "places", to render many
navigations at once, e.g.
a horizontal, a vertical, a top, bottom etc. navigation.

One node could be placed in the top "place", wheras
it's children are placed in the vertical place.

Would it be sufficient to work over the "full_tree_for_model"
tag to allow arguments resulting actually in WHERE-clauses
that exclude certain nodes when building the tree?

Thanks!
Peter.

--~--~-~--~~~---~--~~
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: custom widget necessary?

2008-08-25 Thread peter_g


Thank you, Norman!

> > Do you have links to examples?
>
> http://www.djangosnippets.org/snippets/937/

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



custom widget necessary?

2008-08-25 Thread peter_g

Hi!

I have datetime fields like "createdate" or "modified" in some of my
models.
Do I need to create custom widgets if i want their time and date to
be displayed in the admin area (change-form) and not the default
editable representation (text fields, with "now" etc. shortcuts)?

Like, e.g.

Created: 08/25/2008 09:20am

Do you have links to examples?

Thanks!
Peter.


--~--~-~--~~~---~--~~
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: Inline Editing

2008-08-20 Thread peter_g


...ah, sorry: I was not explicit enough.

I'm looking for the correct way to display one entry block of
"DemoThing"
fields below "MainThing", without any notions of "#1" etc.
And upon saving, Data are stored in both tables.
So that it follows a OneToOne intention.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Inline Editing

2008-08-20 Thread peter_g


Hi!

I use the SVN release and have a newbie problem in the admin area:

I try to display fields for my DemoThing class/model, which I didn't
model
with a OneToOneField, but followed suggestions of a ForeignKey-
approach.

What do I have to change or add so that not only my "MainThing"
gets displayed and editable in the admin area, but also, inline, my
"DemoThing" fields?

--

class MainThing(models.Model):
   titel1 = models.CharField(max_length=100)
   titel2 = models.CharField(max_length=100)
   titel3 = models.CharField(max_length=100)

class DemoThing(models.Model):
   titel1 = models.ForeignKey(MainThing, edit_inline=models.STACKED,
num_in_admin=1, max_num_in_admin=1, unique=True,
num_extra_on_change=0)
   fisch1 = models.CharField(max_length=200, core=True)
   fisch2 = models.CharField(max_length=200, core=True)

class DemoThingInline(admin.StackedInline):
   model = DemoThing
   extra = 1

class MainThingAdmin(admin.ModelAdmin):
   inlines = [DemoThingInline]

admin.site.register(MainThing, MainThingAdmin)

--

Thanks for any hints!

Peter.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---