I have this model.py in Django.
----------------------------------------------
from django.db import models
from django.contrib import admin
class Patient(models.Model):
first_name = models.CharField(max_length=30)
mid_name = models.CharField(max_length=3)
last_name = models.CharField(max_length=30)
birth_date = models.DateField(blank=True, null=True)
address = models.CharField(max_length=50)
city = models.CharField(max_length=60)
state_province = models.CharField(max_length=30)
country = models.CharField(max_length=50)
website = models.URLField(blank=True, null=True)
def __unicode__(self):
return u'%s %s' % (self.first_name, self.last_name)
class Meta:
ordering = ['last_name']
class Doctor(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=40)
speciality = models.CharField(max_length=40)
email = models.EmailField(blank=True, verbose_name='e-mail')
def __unicode__(self):
return u'%s %s' % (self.first_name, self.last_name)
class Pills(models.Model):
title = models.CharField(max_length=100)
substitute = models.CharField(max_length=100, blank=True,
null=True)
reason = models.CharField(max_length=100,blank=True, null=True)
doctor = models.ManyToManyField(Doctor)
patient = models.ForeignKey(Patient)
amount = models.IntegerField(blank=True, null=True)
perscribed = models.CharField(max_length=100,blank=True,
null=True)
def __unicode__(self):
return self.title
class Orders(models.Model):
order_date = models.DateTimeField(blank=True, null=True)
amount_ordered = models.IntegerField(blank=True, null=True)
pills = models.ForeignKey(Pills)
admin.site.register(Doctor)
admin.site.register(Patient)
admin.site.register(Pills)
admin.site.register(Orders)
On Jun 27, 9:59 pm, mdipierro <[email protected]> wrote:
> You say:
>
> > I have a file of people. I have a file of jobs and relate the file by the
> > ID of people.
>
> You can do it but you need to move the data from the files into the
> database. In which format are those files? Can you provide an example?
> Can those files be imported once for all or are they updated by a
> third party program?
>
> Massimo
>
> On Jun 27, 8:58 pm, jayvandal <[email protected]> wrote:
>
>
>
> > .
> > I started in IBM 7080 in assembly, COBOL in IBM7080, IBM 1401,
> > IBM1410, IBM360 series, Basic in DEc, HP, 4th gen in IBM
> > special,language, HP COGNOS,, C language PC, Delphi in , Visual
> > Basic, Euphoria, etc
>
> > I have wrritten system in php, tried some Rails, then went to Grails,
> > then Django, and looking at Turbogears2
> > I found Web2py while looking at Turbogears2.
>
> > I have not found in the frameworks how I can find in master file and
> > show/edit details recods.
>
> > For example
> > I have a file of people. I have a file of jobs and relate the file by
> > the ID of people.
> > ButI can show a list of people, in a dropdown menu, I cannot display
> > the jobs relating to the people, and then add,edit, or delete them.
>
> > Can I do this inWeb2py??
>
> > I show my experience to not brag, but to show how difficult it is for
> > me to relate to OO programing in WEB,
> > I can do this in say Euphoria which is C related, but it is not in a
> > web framework
> > I hope this is not too long, or ?
> > Thanks for any help or examples
> > jvandal- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---