Ignore:
Timestamp:
Aug 30, 2011, 7:38:52 PM (13 years ago)
Author:
rick
Message:

Start building framework for direct import of files.

Location:
src/django_gheat/gheat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/gheat/management/commands/import_datafile.py

    r9632 r9633  
    167167  if sql_values:
    168168    counters['meting_added'] = bulk_sql('gheat_meting (`meetrondje_id`,\
    169       `accespoint_id`, `lat`, `lng`, `signaal`)',sql_values)
     169      `accespoint_id`, `latitude`, `longitude`, `signaal`)',sql_values)
    170170  return counters
    171171
  • src/django_gheat/gheat/models.py

    r9593 r9633  
    127127  def __unicode__(self):
    128128    return "%s - %s" % (self.antenne, self.kaart)
     129  class Meta:
     130    verbose_name_plural = 'Apparatuur'
    129131
    130132class MeetRondje(models.Model):
    131   datum = models.DateTimeField(blank=True,null=True)
     133  datum = models.DateTimeField(blank=True,null=True,default=datetime.datetime.now)
    132134  naam = models.CharField(max_length=64)
    133135  gebruiker = models.ForeignKey(Gebruiker)
     
    135137  def __unicode__(self):
    136138    return "%s - %s" % (self.gebruiker.naam, self.naam)
     139  class Meta:
     140    verbose_name_plural = 'MeetRondjes'
    137141
    138142class MeetBestand(models.Model):
    139143  meetrondje = models.ForeignKey(MeetRondje)
    140   bestand = models.FileField(upload_to='meet-bestand/%Y/%m/%d')
     144  bestand = models.FileField(upload_to='scan-data/%Y/%m/%d')
     145  is_imported = models.BooleanField(default=False)
     146  class Meta:
     147    verbose_name_plural = 'MeetBestanden'
    141148 
    142149
     
    144151  meetrondje = models.ForeignKey(MeetRondje)
    145152  accespoint = models.ForeignKey(Accespoint)
    146   latitude = models.FloatField(name='Latitude', db_column='lat')
    147   longitude = models.FloatField(name='Longitude', db_column='lng')
     153  latitude = models.FloatField()
     154  longitude = models.FloatField()
    148155  signaal = models.IntegerField(max_length=3)
    149156  objects = managers.MetingManager()
     
    155162    # this properly hold.
    156163    unique_together = ('meetrondje', 'accespoint', 'latitude', 'longitude'),
     164    verbose_name_plural = 'Metingen'
     165
Note: See TracChangeset for help on using the changeset viewer.