django Search page

32 views
Skip to first unread message

Sabeen Sha

unread,
Mar 2, 2015, 2:27:35 AM3/2/15
to django...@googlegroups.com

which is the best way to implement the following::
i will be having a text box and a Add button

Along with a table below it containing headers class AssesmentBuildingDetails(models.Model):


numbuildingid1 = models.CharField(max_length=14,unique=True)

numbuildingid2 = models.CharField(max_length=7,primary_key=True)

previous_year = models.CharField(max_length=4, blank=True)

previous_year_wardname = models.CharField(max_length=100,blank=True, null=True)

previous_doorno1 = models.CharField(max_length=4,blank=True, null=True)

previous_doorno2 = models.CharField(max_length=10,blank=True, null=True)

current_year = models.CharField(max_length=4, blank=True)

current_year_wardname = models.CharField(max_length=100,blank=True, null=True)

current_doorno1 = models.CharField(max_length=10,blank=True, null=True)

current_doorno2 = models.CharField(max_length=10,blank=True, null=True)

buildingusage = models.CharField(max_length=500,blank=True, null=True)

ownernameaddressmal = models.CharField(max_length=500,blank=True, null=True)

ownernameaddresseng = models.CharField(max_length=500,blank=True, null=True)

plintaarea = models.DecimalField(max_digits=7, decimal_places=2,blank=True, null=True)

class Meta:

db_table = 'assesment_building_details'



my logic is to take the numbuildingid2 as input from the text box and when i press enter either on the text field or click the add button it should search through the database
and add the details to the table without refreshing the whole page. and the clear the textfield and focus on it.
 It will give proper error msg if the numbuildingid2 is not found

please help how and which is the best way to implement this...

thanks


Collin Anderson

unread,
Mar 6, 2015, 5:17:41 PM3/6/15
to django...@googlegroups.com
Hi,

You'll need to use javascript for that.

Collin
Reply all
Reply to author
Forward
0 new messages