Re: Access Control Lists implementation for Django?

2009-01-05 Thread Mir Nazim

Thanks guys

Will check out both. And let you know my reactions

On Tue, Jan 6, 2009 at 1:16 AM, bruno desthuilliers
 wrote:
>
> On 5 jan, 10:55, "Mir Nazim"  wrote:
>> Hello Guys
>>
>> I was wondering that is there any 3rd party ACL implementation for
>> django. Django's permission system is a bit limited for the app we are
>> working on.
>> Actually, a per object access control is needed.
>
> There's a granular_permissions app, but it requires a couple patches
> (submitted but not applied so far...) to work correctly with current
> django versions. It could at least get you started.
>
> http://code.google.com/p/django-granular-permissions/
> >
>



-- 
Mir Nazim
Cell: +91 9469071855
Blog: http://saunzal.org
Company:http://www.ikraftsoft.com

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



Access Control Lists implementation for Django?

2009-01-05 Thread Mir Nazim

Hello Guys

I was wondering that is there any 3rd party ACL implementation for
django. Django's permission system is a bit limited for the app we are
working on.
Actually, a per object access control is needed.

Thank you in advance for any suggestions.

-- 
Mir Nazim
Cell: +91 9469071855
Blog: http://saunzal.org
Company:http://www.ikraftsoft.com

--~--~-~--~~~---~--~~
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: Something like a mini Crystal Reports with Django

2007-08-05 Thread Mir Nazim

Cool cool cool

We will be waiting.

One request, I am unable to access the svn with http protocol due my
ISP not ready to configure its Firewall to allow all http methods. So
could you please set it up under https or svn+ssh

Thanks

On Aug 6, 6:47 am, "Ben Ford" <[EMAIL PROTECTED]> wrote:
> Hi guys,
> Thanks for the interest! I'll split it up from my main app and put it into
> SVN on my server. I'd really like comments on some of the design decisions
> I've made, I was thinking about it last night and I think I may have got a
> bit too clever! I'll post on here when I've got everything figured. :-)
> Ben
>
> On 05/08/07, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Ho ho,
>
> > Its generating a lot of interest.
>
> > On Aug 4, 3:18 pm, "Chris Hoeppner" <[EMAIL PROTECTED]> wrote:
> > > Need another tester? Count me in.
>
> > > 2007/8/4, Mir Nazim <[EMAIL PROTECTED]>:
>
> > > > Me too me too.
>
> > > > Ben, Let us know if you need help with testing or some thing else.
> > > > I will more interested in Models and View than template.
>
> > > > On Aug 3, 11:51 am, "Matt Davies" <[EMAIL PROTECTED]> wrote:
> > > > > Ben, I'd be interested in looking at that application.
>
> > > > > Need someone to help with testing?
>
> > > > > On 03/08/07, Ben Ford <[EMAIL PROTECTED]> wrote:
>
> > > > > > I'm working on a django app at the moment that allows you to
> > define and
> > > > > > save reports. It has a method similar to templatetags for loading
> > user
> > > > > > defined functions to add to the reports too. As it stands you can
> > build and
> > > > > > save these reports with a web front end, and download the results
> > in CSV. I
> > > > > > just need to write a front end for creating filters and it'll be
> > good to go.
> > > > > > I'll be happy to release it for the benefit of others when it's
> > done.
> > > > > > Ben
>
> > > > > > On 03/08/07, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > > > I understand that views need to be created. I am doing that
> > these
> > > > > > > days.
>
> > > > > > > What specifically I wanted to know is whether anyone else has
> > worked
> > > > > > > on a similar stuff. So he might want to share his experience.
>
> > > > > > > BRIT is Java. I would prefer something more python based
> > solution.
> > > > > > > even better is there is a django based one. If there is none,
> > its
> > > > > > > obvious I will have to create one.
>
> > > > > > > On Aug 2, 8:20 pm, Lucky B < [EMAIL PROTECTED]> wrote:
> > > > > > > > You could try Eclipse BIRT for a WYSIWYG interface. But
> > otherwise you
> > > > > > > > can create a view however you want to report your data doing
> > whatever
> > > > > > > > manipulation you wanted. I don't see what else you would need
> > other
> > > > > > > > than to create a view.
>
> > > > > > > > On Aug 2, 5:17 am, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > Anybody has any views on this.
>
> > > > > > > > > --
> > > > > > > > > PS: posting just to keep this topic fresh
>
> > > > > > > > > On Jul 31, 4:28 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > Hello
>
> > > > > > > > > > I was wondering has anybody done application that was
> > something
> > > > > > > like a
> > > > > > > > > > mini crystal reports. Generating a report based of model
> > items
> > > > > > > > > > selected in a WYSIWYG(ok this is not important)
> > fashion.  And
> > > > > > > > > > generating a HTML tables based report with defined
> > calculations
> > > > > > > etc.
>
> > > > > > > > > > I understand that Django Admin has some kind of similar
> > > > > > > facilities. I
> > > > > > > > > > am looking into them. In the mean time thought that may be
> > some
> > > > > > > one
> > > > > > > > > > else might be doing similar stuff somewhere.
>
> > > > > > --
> > > > > > Regards,
> > > > > > Ben Ford
> > > > > > [EMAIL PROTECTED]
> > > > > > +628111880346
>
> > > --
> > > Best Regards,
> > > Chris Hoeppner -www.pixware.org//My weblog
>
> --
> Regards,
> Ben Ford
> [EMAIL PROTECTED]
> +628111880346


--~--~-~--~~~---~--~~
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: Something like a mini Crystal Reports with Django

2007-08-05 Thread Mir Nazim

Ho ho,

Its generating a lot of interest.

On Aug 4, 3:18 pm, "Chris Hoeppner" <[EMAIL PROTECTED]> wrote:
> Need another tester? Count me in.
>
> 2007/8/4, Mir Nazim <[EMAIL PROTECTED]>:
>
>
>
>
>
> > Me too me too.
>
> > Ben, Let us know if you need help with testing or some thing else.
> > I will more interested in Models and View than template.
>
> > On Aug 3, 11:51 am, "Matt Davies" <[EMAIL PROTECTED]> wrote:
> > > Ben, I'd be interested in looking at that application.
>
> > > Need someone to help with testing?
>
> > > On 03/08/07, Ben Ford <[EMAIL PROTECTED]> wrote:
>
> > > > I'm working on a django app at the moment that allows you to define and
> > > > save reports. It has a method similar to templatetags for loading user
> > > > defined functions to add to the reports too. As it stands you can build 
> > > > and
> > > > save these reports with a web front end, and download the results in 
> > > > CSV. I
> > > > just need to write a front end for creating filters and it'll be good 
> > > > to go.
> > > > I'll be happy to release it for the benefit of others when it's done.
> > > > Ben
>
> > > > On 03/08/07, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > I understand that views need to be created. I am doing that these
> > > > > days.
>
> > > > > What specifically I wanted to know is whether anyone else has worked
> > > > > on a similar stuff. So he might want to share his experience.
>
> > > > > BRIT is Java. I would prefer something more python based solution.
> > > > > even better is there is a django based one. If there is none, its
> > > > > obvious I will have to create one.
>
> > > > > On Aug 2, 8:20 pm, Lucky B < [EMAIL PROTECTED]> wrote:
> > > > > > You could try Eclipse BIRT for a WYSIWYG interface. But otherwise 
> > > > > > you
> > > > > > can create a view however you want to report your data doing 
> > > > > > whatever
> > > > > > manipulation you wanted. I don't see what else you would need other
> > > > > > than to create a view.
>
> > > > > > On Aug 2, 5:17 am, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Anybody has any views on this.
>
> > > > > > > --
> > > > > > > PS: posting just to keep this topic fresh
>
> > > > > > > On Jul 31, 4:28 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Hello
>
> > > > > > > > I was wondering has anybody done application that was something
> > > > > like a
> > > > > > > > mini crystal reports. Generating a report based of model items
> > > > > > > > selected in a WYSIWYG(ok this is not important) fashion.  And
> > > > > > > > generating a HTML tables based report with defined calculations
> > > > > etc.
>
> > > > > > > > I understand that Django Admin has some kind of similar
> > > > > facilities. I
> > > > > > > > am looking into them. In the mean time thought that may be some
> > > > > one
> > > > > > > > else might be doing similar stuff somewhere.
>
> > > > --
> > > > Regards,
> > > > Ben Ford
> > > > [EMAIL PROTECTED]
> > > > +628111880346
>
> --
> Best Regards,
> Chris Hoeppner -www.pixware.org// My weblog


--~--~-~--~~~---~--~~
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: Something like a mini Crystal Reports with Django

2007-08-04 Thread Mir Nazim

Me too me too.

Ben, Let us know if you need help with testing or some thing else.
I will more interested in Models and View than template.



On Aug 3, 11:51 am, "Matt Davies" <[EMAIL PROTECTED]> wrote:
> Ben, I'd be interested in looking at that application.
>
> Need someone to help with testing?
>
> On 03/08/07, Ben Ford <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm working on a django app at the moment that allows you to define and
> > save reports. It has a method similar to templatetags for loading user
> > defined functions to add to the reports too. As it stands you can build and
> > save these reports with a web front end, and download the results in CSV. I
> > just need to write a front end for creating filters and it'll be good to go.
> > I'll be happy to release it for the benefit of others when it's done.
> > Ben
>
> > On 03/08/07, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > I understand that views need to be created. I am doing that these
> > > days.
>
> > > What specifically I wanted to know is whether anyone else has worked
> > > on a similar stuff. So he might want to share his experience.
>
> > > BRIT is Java. I would prefer something more python based solution.
> > > even better is there is a django based one. If there is none, its
> > > obvious I will have to create one.
>
> > > On Aug 2, 8:20 pm, Lucky B < [EMAIL PROTECTED]> wrote:
> > > > You could try Eclipse BIRT for a WYSIWYG interface. But otherwise you
> > > > can create a view however you want to report your data doing whatever
> > > > manipulation you wanted. I don't see what else you would need other
> > > > than to create a view.
>
> > > > On Aug 2, 5:17 am, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > Anybody has any views on this.
>
> > > > > --
> > > > > PS: posting just to keep this topic fresh
>
> > > > > On Jul 31, 4:28 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello
>
> > > > > > I was wondering has anybody done application that was something
> > > like a
> > > > > > mini crystal reports. Generating a report based of model items
> > > > > > selected in a WYSIWYG(ok this is not important) fashion.  And
> > > > > > generating a HTML tables based report with defined calculations
> > > etc.
>
> > > > > > I understand that Django Admin has some kind of similar
> > > facilities. I
> > > > > > am looking into them. In the mean time thought that may be some
> > > one
> > > > > > else might be doing similar stuff somewhere.
>
> > --
> > Regards,
> > Ben Ford
> > [EMAIL PROTECTED]
> > +628111880346


--~--~-~--~~~---~--~~
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: Something like a mini Crystal Reports with Django

2007-08-02 Thread Mir Nazim

I understand that views need to be created. I am doing that these
days.

What specifically I wanted to know is whether anyone else has worked
on a similar stuff. So he might want to share his experience.

BRIT is Java. I would prefer something more python based solution.
even better is there is a django based one. If there is none, its
obvious I will have to create one.


On Aug 2, 8:20 pm, Lucky B <[EMAIL PROTECTED]> wrote:
> You could try Eclipse BIRT for a WYSIWYG interface. But otherwise you
> can create a view however you want to report your data doing whatever
> manipulation you wanted. I don't see what else you would need other
> than to create a view.
>
> On Aug 2, 5:17 am, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > Anybody has any views on this.
>
> > --
> > PS: posting just to keep this topic fresh
>
> > On Jul 31, 4:28 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > > Hello
>
> > > I was wondering has anybody done application that was something like a
> > > mini crystal reports. Generating a report based of model items
> > > selected in a WYSIWYG(ok this is not important) fashion.  And
> > > generating a HTML tables based report with defined calculations etc.
>
> > > I understand that Django Admin has some kind of similar facilities. I
> > > am looking into them. In the mean time thought that may be some one
> > > else might be doing similar stuff somewhere.


--~--~-~--~~~---~--~~
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: Something like a mini Crystal Reports with Django

2007-08-02 Thread Mir Nazim

Anybody has any views on this.

--
PS: posting just to keep this topic fresh

On Jul 31, 4:28 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
> Hello
>
> I was wondering has anybody done application that was something like a
> mini crystal reports. Generating a report based of model items
> selected in a WYSIWYG(ok this is not important) fashion.  And
> generating a HTML tables based report with defined calculations etc.
>
> I understand that Django Admin has some kind of similar facilities. I
> am looking into them. In the mean time thought that may be some one
> else might be doing similar stuff somewhere.


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



Something like a mini Crystal Reports with Django

2007-07-31 Thread Mir Nazim

Hello

I was wondering has anybody done application that was something like a
mini crystal reports. Generating a report based of model items
selected in a WYSIWYG(ok this is not important) fashion.  And
generating a HTML tables based report with defined calculations etc.

I understand that Django Admin has some kind of similar facilities. I
am looking into them. In the mean time thought that may be some one
else might be doing similar stuff somewhere.


--~--~-~--~~~---~--~~
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: Maintaining history of changes to model fields

2007-07-30 Thread Mir Nazim

Oho yes yes.

Did not realize that. It just escaped my mind.

Thanks a lot for reminding

On Jul 30, 12:01 pm, oggie rob <[EMAIL PROTECTED]> wrote:
> The admin interface contains a history feature, you might want to look
> at how that works. Apart from a table to record the actual changes,
> there is a "relationship" table that links the model that is changed
> with the log record (i.e. the log isn't tied to a particular table
> because of this).
> Table names are "django_admin_log" and "django_content_type"
>
>  -rob
>
> On Jul 29, 11:01 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
>
> > Hello
>
> > I was wondering what is the best possible way of maintaning history of
> > changes to the fields of models.
>
> > Like we do in Bug trackers, where we maintain a complete log of
> > changes to the fields.
>
> > One simple solution that came to my mind is creating a model History.
> > as
>
> > class History(models.Model):
> > model_changed = models.CharField(maxlength=255, blank=False)
> > old_data = models.TextField(blank=False)
> > created = models.DateTimeField(auto_now = True)
>
> > Then before saving the model objects its old value get pushed in the
> > History.old_data in json, pickle or some other format. But this is
> > very bad way to do it. Because generating reports is not a simple task
> > when using pickled data.
>
> > You guys might have faced similar problems, can any one suggest a
> > better way of maintaining history.
>
> > One thing to consider here however is that models  are deeply
> > connected with lot of relationships between them.
>
> > Thanks


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



Maintaining history of changes to model fields

2007-07-29 Thread Mir Nazim

Hello

I was wondering what is the best possible way of maintaning history of
changes to the fields of models.

Like we do in Bug trackers, where we maintain a complete log of
changes to the fields.

One simple solution that came to my mind is creating a model History.
as


class History(models.Model):
model_changed = models.CharField(maxlength=255, blank=False)
old_data = models.TextField(blank=False)
created = models.DateTimeField(auto_now = True)



Then before saving the model objects its old value get pushed in the
History.old_data in json, pickle or some other format. But this is
very bad way to do it. Because generating reports is not a simple task
when using pickled data.

You guys might have faced similar problems, can any one suggest a
better way of maintaining history.

One thing to consider here however is that models  are deeply
connected with lot of relationships between them.

Thanks


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



Maintaining history of changes to model fields

2007-07-29 Thread Mir Nazim

Hello

I was wondering what is the best possible way of maintaning history of
changes to the fields of models.

Like we do in Bug trackers, where we maintain a complete log of
changes to the fields.

One simple solution that came to my mind is creating a model History.
as


class History(models.Model):
model_changed = models.CharField(maxlength=255, blank=False)
old_data = models.TextField(blank=False)
created = models.DateTimeField(auto_now = True)



Then before saving the model objects its old value get pushed in the
History.old_data in json, pickle or some other format. But this is
very bad way to do it. Because generating reports is not a simple task
when using pickled data.

You guys might have faced similar problems, can any one suggest a
better way of maintaining history.

One thig to consider here however is that models  are deeply connected
with lot of relationships between them.


--~--~-~--~~~---~--~~
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: How about a Django apps public repository?

2006-09-08 Thread Mir Nazim

Hey Djangoers,

check out www.devjavu.com

looks cool

PS: www.tracOS.com


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



Re: How to handle person to person relationships

2006-08-30 Thread Mir Nazim

I know that but my problem is that it is still undocumented. I am an
absolute newbie in case of django and web development in python.
Though I have used python for quite some time.

CAn you provide some link that documents content-type system.

On 8/30/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
> On 8/30/06, Mir Nazim <[EMAIL PROTECTED]> wrote:
> > Now comes another problem, I have read generic relationships document
> > at django site. but can anyone point me to some urls where thing like
> > content-type etc(that are need for generic relationship to work)
> > described in detail. The solution defined in that document
> > http://www.djangoproject.com/documentation/models/generic_relations/
> > seem cool and usable. just need to understand the background more
>
> django.contrib.comments uses contenttype pretty extensively:
> http://code.djangoproject.com/browser/django/trunk/django/contrib/comments
>
> >
>


-- 

MA SALAAM
-
 Mir Nazim   http://mirnazim.wordpress.com
-
 XenSoft Labshttp://www.xensoftlabs.com
-

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



Re: How to handle person to person relationships

2006-08-30 Thread Mir Nazim


Jeremy Dunck wrote:
> On 8/29/06, Mir Nazim <[EMAIL PROTECTED]> wrote:
> >
> > I have already gone through that. but problem is that I need to add
> > some attributes to relationships like
> >
> > he is my best friend
> > i have not met him
> >
> > something like orkut.
>
> If you're going to attach view and template behavior based on the
> different relationship types as you add them, then I think it makes
> sense to just have a separate attribute field on the Person model for
> each relationship type.
>
> class Person(models.Model):
> ...
>contacts = models.ManyToManyField('self')
>friends = models.ManyToManyField('self')
>enemies = models.ManyToManyField('self')

Yes you are right, Jermy,

That is the approach we are taking now. actually now it will be only
contacts field. All ther classification will be handled using a generic
taxonomy system(taging).

Now comes another problem, I have read generic relationships document
at django site. but can anyone point me to some urls where thing like
content-type etc(that are need for generic relationship to work)
described in detail. The solution defined in that document
http://www.djangoproject.com/documentation/models/generic_relations/
seem cool and usable. just need to understand the background more

Regards
Mir Nazim


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



Re: How to handle person to person relationships

2006-08-29 Thread Mir Nazim

I have already gone through that. but problem is that I need to add
some attributes to relationships like

he is my best friend
i have not met him

something like orkut.


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



How to handle person to person relationships

2006-08-29 Thread Mir Nazim

How code the relationship like
"a person has many friends"

code so far.

class Person(models.Model):
full_name = models.CharField(maxlength=100)
nick_name = models.CharField(maxlength=20)
about = models.TextField(blank=True)
sex = models.CharField(maxlength=1, choices=SEXES)

# contact is also a person object so it is a reference to same
person
# more study needs to be done on how to add attributes to
ManyToMany relationship in Django
# e.g. we may need to define whether a contact is my friend etc.
# creating a separate class for Contact may not be the a good
solution, since a Contact is also a Person
contacts = models.ManyToManyField('self')


Or like this

class PersonRelation(models.Model):
person = models.ForeignKey(Person)
relations = models.ManyToManyField(Person, related_name =
'friends')
type = models.IntegerField(choices=FRIEND_TYPES)
group = models.IntegerField(choices=GROUP_TYPES)



please highlight pros and cons.


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



Re: How do I handel multiple foriegn keys in single model

2006-04-08 Thread Mir Nazim

this seems good.
can i get a code example. :))


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



How do I handel multiple foriegn keys in single model

2006-04-04 Thread Mir Nazim

Here is the piece of code

class Person(meta.Model):
first_name = meta.CharField(maxlength = 100)
last_name = meta.CharField(maxlength = 100)

class EmailType(meta.Model):
title = meta.CharField(maxlength = 100)
description = meta.CharField(maxlength = 100)

class PersonEmail(meta.Model):
person = meta.ForeignKey(Person)
email_type = meta.ForeignKey(EmailType)
email = meta.CharField(maxlength = 100)


Person is a model class for one person.
EmailType is like primary email, Scondary, Business, Personal etc
EmailPerson the mapping between persons email and email types(person
can have more than one email)

Now when I create a person object I assign him an email like

p.add_email(email='[EMAIL PROTECTED]')

here i ma ignoring the fact that i have an email type also. Now I am
unable to figure out how to add email as well as email type to person

can any one help out.


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