Re: How does the database modeling work?

2007-08-07 Thread eggie5

Wow, that's pretty deep stuff for never really looking at python
before...

On Aug 7, 1:04 pm, Nicola Larosa <[EMAIL PROTECTED]> wrote:
> eggie5 wrote:
> > I'm not a python or django user,
>
> Why not consider becoming one? :-) You may start with IronPython.
>
> > but in the past couple days I've
> > become fascinated with Django. Mostly how the database modeling works.
> > It seems so elegant, something that doesn't exist in asp.net world.
>
> No ORMs for any CLR language? Peculiar. Try running Django on IronPython. :-)
>
> > I've been looking at the source to see how it's implemented because I
> > wanted to recreate parts of it i my C# asp.net app.
>
> You're going the wrong direction. ;-)
>
> > My question is how does django get the field names for the DB. Does it
> > do some type of reflection on People class?
>
> Try looking at this:
>
> http://code.djangoproject.com/wiki/DevModelCreation
>
> --
> Nicola Larosa -http://www.tekNico.net/
>
> These three disciplines - writing, engineering, and artistry - are not
> so different from one another. [...] When you're able to think easily
> in all three modes one by one, you will soon find yourself thinking in
> all three simultaneously. The writer, engineer and artist overlap and
> merge, Voltron-style, to form The Designer. -- Craig Cook, January 2007


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



How does the database modeling work?

2007-08-07 Thread eggie5

Hi,

I'm not a python or django user, but in the past couple days I've
become fascinated with Django. Mostly how the database modeling works.
It seems so elegant, something that doesn't exist in asp.net world.

I've been looking at the source to see how it's implemented because I
wanted to recreate parts of it i my C# asp.net app.

My main focus right now is the Model class. This is the base class of
any models the user creates. e.g.:

class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)

This is sub classing the Model Class right. This is my C# duplicate:

 public class Person : Model
{
public Person(int contentID, Subscriber subscriber, DateTime
timeSent, bool confirmed, string fileSent, int adIDDelivered)
{
this.first_name = contentID;
this.last_name = subscriber;;
}
   }

And this is my model class so far:

 public class Model
{
public Model()
{

}

public static Manager Objects;

public void Save()
{

}

public void Delete()
{
}

}

My question is how does django get the field names for the DB. Does it
do some type of reflection on People class?


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