Changeset 9819 for src/django_gheat


Ignore:
Timestamp:
Dec 23, 2011, 8:31:50 AM (13 years ago)
Author:
rick
Message:

Correct annoying typo in naming of the acces*s* point.

Location:
src/django_gheat
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/gheat/admin.py

    r9818 r9819  
    22from django.contrib import admin
    33
    4 class AccespointAdmin(admin.ModelAdmin):
     4class AccesspointAdmin(admin.ModelAdmin):
    55  list_display = ['ssid','type', 'mac', 'organization']
    66  search_fields = ['ssid', 'mac', 'organization']
    77  ordering = ['ssid']
    8 admin.site.register(Accespoint, AccespointAdmin)
     8admin.site.register(Accesspoint, AccesspointAdmin)
    99
    1010class MeetBestandInline(admin.TabularInline):
     
    3535
    3636class MetingAdmin(admin.ModelAdmin):
    37   list_display = ['accespoint', 'latitude', 'longitude', 'signaal']
    38   search_fields = ['accespoint__ssid']
     37  list_display = ['accesspoint', 'latitude', 'longitude', 'signaal']
     38  search_fields = ['accesspoint__ssid']
    3939admin.site.register(Meting, MetingAdmin)
  • src/django_gheat/gheat/base.py

    r9041 r9819  
    77import gheat
    88import gheat.opacity
    9 from gheat.models import Accespoint, Gebruiker, Meting
     9from gheat.models import Accesspoint, Gebruiker, Meting
    1010from gheat import gheatsettings as settings
    1111from gheat import gmerc
  • src/django_gheat/gheat/dataimport/__init__.py

    r9818 r9819  
    7474
    7575
    76 def import_accespoints(ap_pool, counters):
    77   # Determine which Accespoints to add
    78   bssid_list_present = Accespoint.objects.filter(mac__in=ap_pool.keys()).\
     76def import_accesspoints(ap_pool, counters):
     77  # Determine which Accesspoints to add
     78  bssid_list_present = Accesspoint.objects.filter(mac__in=ap_pool.keys()).\
    7979    values_list('mac', flat=True)
    8080  bssid_list_insert = set(ap_pool.keys()) - set(bssid_list_present)
     
    8585    for bssid in bssid_list_insert:
    8686      ssid, encryption = ap_pool[bssid]
    87       type = Accespoint.get_type_by_ssid(ssid)
     87      type = Accesspoint.get_type_by_ssid(ssid)
    8888      # Special trick in SSID ts avoid escaping in later stage
    8989      item = str((bssid.upper(),ssid.replace('%','%%'),encryption,
    90          Accespoint.get_type_by_ssid(ssid),
     90         Accesspoint.get_type_by_ssid(ssid),
    9191        get_organization_id_by_ssid(ssid)))
    9292      sql_values.append(item)
    93     counters['ap_added'] = bulk_sql('gheat_accespoint (`mac`, `ssid`,\
     93    counters['ap_added'] = bulk_sql('gheat_accesspoint (`mac`, `ssid`,\
    9494      `encryptie`, `type`, `organization_id`)',sql_values)
    9595  return counters
     
    104104  # Build mapping for meting import
    105105  mac2id = {}
    106   for mac,id in Accespoint.objects.filter(mac__in=bssid_list).\
     106  for mac,id in Accesspoint.objects.filter(mac__in=bssid_list).\
    107107    values_list('mac','id'):
    108108    mac2id[mac] = int(id)
     
    134134  if sql_values:
    135135    counters['meting_added'] = bulk_sql('gheat_meting (`meetrondje_id`,\
    136       `accespoint_id`, `latitude`, `longitude`, `signaal`)',sql_values)
     136      `accesspoint_id`, `latitude`, `longitude`, `signaal`)',sql_values)
    137137  return counters
    138138
     
    186186
    187187  if ap_pool:
    188     counters = import_accespoints(ap_pool, counters)
     188    counters = import_accesspoints(ap_pool, counters)
    189189  if client_pool:
    190190    counters = import_clients(client_pool, counters)
     
    192192    counters = import_metingen(meetrondje, meting_pool, counters)
    193193
    194   logger.debug("summary accespoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
     194  logger.debug("summary accesspoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
    195195  logger.debug("summary client     : total:%(client_total)-6s added:%(client_added)-6s failed:%(client_failed)-6s ignored:%(client_ignored)-6s" % counters)
    196196  logger.debug("summary metingen   : total:%(meting_total)-6s added:%(meting_added)-6s failed:%(meting_failed)-6s ignored:%(meting_ignored)-6s" % counters)
  • src/django_gheat/gheat/dataimport/kismet.py

    r9668 r9819  
    1717    raise IOError(e)
    1818
    19   # Prepare new accespoints and measurements
     19  # Prepare new accesspoints and measurements
    2020  wnetworks = netxml_doc.findall('wireless-network')
    2121
     
    5555  bssid_failed = defaultdict(int)
    5656
    57   # Prepare new accespoints and measurements
     57  # Prepare new accesspoints and measurements
    5858  points = gpsxml_doc.findall('gps-point')
    5959
  • src/django_gheat/gheat/management/commands/add_random_points.py

    r9057 r9819  
    1919  equipment, created = Apparatuur.objects.get_or_create(antenne='itern', kaart='device')
    2020
    21   accespoint, created = Accespoint.objects.get_or_create(mac='00:11:22:33:44',
     21  accesspoint, created = Accesspoint.objects.get_or_create(mac='00:11:22:33:44',
    2222    ssid='ap-WirelessLeiden-Test', encryptie=True)
    2323
     
    2727  rondje.save()
    2828
    29   sql_insert = "INSERT INTO gheat_meting (meetrondje_id, accespoint_id, lat, lng, signaal) VALUES ";
     29  sql_insert = "INSERT INTO gheat_meting (meetrondje_id, accesspoint_id, lat, lng, signaal) VALUES ";
    3030  sql_insert_values = []
    3131  for i in range(0,count):
     
    3838    #  print "#Importing Random mesurements: %s/%s" % (i,count)
    3939    #meting = Meting.objects.create(meetrondje=rondje,
    40     #    accespoint=accespoint,latitude=latitude,
     40    #    accesspoint=accesspoint,latitude=latitude,
    4141    #    longitude=longitude,signaal=signal)
    4242    #meting.save()
    43     sql_insert_values.append("('" + "','".join(map(str,[rondje.id, accespoint.id, latitude, longitude, signal])) + "')")
     43    sql_insert_values.append("('" + "','".join(map(str,[rondje.id, accesspoint.id, latitude, longitude, signal])) + "')")
    4444
    4545  sql_insert += ','.join(sql_insert_values) + ';';
  • src/django_gheat/gheat/management/commands/import_datafile.py

    r9669 r9819  
    139139
    140140      counters = import_file(filename,meetrondje)
    141       logger.info("summary accespoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
     141      logger.info("summary accesspoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
    142142      logger.info("summary client     : total:%(client_total)-6s added:%(client_added)-6s failed:%(client_failed)-6s ignored:%(client_ignored)-6s" % counters)
    143143      logger.info("summary metingen   : total:%(meting_total)-6s added:%(meting_added)-6s failed:%(meting_failed)-6s ignored:%(meting_ignored)-6s" % counters)
  • src/django_gheat/gheat/models.py

    r9818 r9819  
    77MAX_SIGNAL = 100
    88
    9 ACCESPOINT_TYPE_CHOICES= (
    10   ('accespoint', 'Acess Point'),
     9ACCESSPOINT_TYPE_CHOICES= (
     10  ('accesspoint', 'Acess Point'),
    1111  ('interlink', 'InterLink'),
    1212)
     
    7272    return "%s - %s" % (self.name, self.organization)
    7373
    74 class Accespoint(models.Model):
     74class Accesspoint(models.Model):
    7575  mac = models.CharField(max_length=17)
    7676  ssid = models.CharField(max_length=64)
    77   type = models.CharField(max_length=20, null=True, blank=True, choices=ACCESPOINT_TYPE_CHOICES)
     77  type = models.CharField(max_length=20, null=True, blank=True, choices=ACCESSPOINT_TYPE_CHOICES)
    7878  organization = models.ForeignKey(Organization,null=True, blank=True)
    7979  encryptie = models.BooleanField()
     
    8686  def get_type_by_ssid(ssid):
    8787    if ssid.startswith('ap'):
    88       type = 'accespoint'
     88      type = 'accesspoint'
    8989    elif ssid.startswith('il'):
    9090      type = 'interlink'
     
    9494
    9595  def save(self, *args, **kwargs):
    96     super(Accespoint, self).save(*args, **kwargs)
     96    super(Accesspoint, self).save(*args, **kwargs)
    9797
    9898class Gebruiker(models.Model):
     
    141141class Meting(models.Model):
    142142  meetrondje = models.ForeignKey(MeetRondje)
    143   accespoint = models.ForeignKey(Accespoint)
     143  accesspoint = models.ForeignKey(Accesspoint)
    144144  latitude = models.FloatField()
    145145  longitude = models.FloatField()
    146146  signaal = IntegerRangeField(max_length=3,min_value=MIN_SIGNAL,max_value=MAX_SIGNAL)
    147147  def __unicode__(self):
    148     return "%s @ %.5f,%.5f : %s" % (self.accespoint.ssid, float(self.latitude), float(self.longitude), self.signaal)
     148    return "%s @ %.5f,%.5f : %s" % (self.accesspoint.ssid, float(self.latitude), float(self.longitude), self.signaal)
    149149  class Meta:
    150150    # This implies that you cannot have multiple messurements on the same
    151151    # location for a single 'run', thus the data needs cleaned before to make
    152152    # this properly hold.
    153     unique_together = ('meetrondje', 'accespoint', 'latitude', 'longitude'),
     153    unique_together = ('meetrondje', 'accesspoint', 'latitude', 'longitude'),
    154154    verbose_name_plural = 'Metingen'
    155155
  • src/django_gheat/wlheatmap/filters.py

    r9778 r9819  
    1818    sum_ssid = set()
    1919    for mr in MeetRondje.objects.filter(gebruiker=user).order_by('naam'):
    20       # Get list if accespoints found in the specific 'Meting', and make this is list.
     20      # Get list if accesspoints found in the specific 'Meting', and make this is list.
    2121      wirelessleiden_ssid = Meting.objects.filter(meetrondje=mr,
    22         accespoint__organization__name__startswith='Wireless').\
    23         values_list('accespoint__ssid',flat=True).\
    24         order_by('accespoint__ssid').distinct()
     22        accesspoint__organization__name__startswith='Wireless').\
     23        values_list('accesspoint__ssid',flat=True).\
     24        order_by('accesspoint__ssid').distinct()
    2525      # The explicit cast to list is required as django lists are special and
    2626      # cannot be handled by simplejson.
  • src/django_gheat/wlheatmap/nodelist.py

    r9596 r9819  
    4747  })
    4848
    49   objquery = Accespoint.objects.filter(**filter).distinct()
     49  objquery = Accesspoint.objects.filter(**filter).distinct()
    5050  nodelist = serializers.serialize('json', objquery, fields=('fields','ssid'))
    5151
  • src/django_gheat/wlheatmap/static/heatmap_extensions.js

    r9816 r9819  
    313313          initialize: function(name, options) {
    314314            var url = [
    315               "tile/${z}/${x},${y}.png?&colour=" + colour + "&accespoint__ssid=" + node
     315              "tile/${z}/${x},${y}.png?&colour=" + colour + "&accesspoint__ssid=" + node
    316316            ];
    317317            options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
     
    357357    }
    358358    if (wlnode != 'all') {
    359       query_array.push('accespoint__ssid=' + wlnode);
     359      query_array.push('accesspoint__ssid=' + wlnode);
    360360    }
    361361    if (nodetype) {
  • src/django_gheat/wlheatmap/templates/home.html

    r9816 r9819  
    4747          <select id="select_node" style="width:104px"></select> Node<br />
    4848          <select id="select_nodetype" style="width:104px">
    49             <option value="accespoint__ssid__icontains=ap-WirelessLeiden">WL Nodes</option>
    50             <option value="accespoint__ssid__icontains=WirelessLeiden">WL Nodes &amp; WL InterLinks</option>
     49            <option value="accesspoint__ssid__icontains=ap-WirelessLeiden">WL Nodes</option>
     50            <option value="accesspoint__ssid__icontains=WirelessLeiden">WL Nodes &amp; WL InterLinks</option>
    5151            <option value="">Alle AccessPoints (ook niet WL)</option>
    5252          </select> Type<br />
  • src/django_gheat/wlheatmap/templates/js/LayerBase.js

    r9653 r9819  
    162162
    163163/**
    164  * All accespoints
     164 * All accesspoints
    165165 */
    166166OpenLayers.Layer.OSM.Overlay2 = OpenLayers.Class(OpenLayers.Layer.OSM, {
     
    182182    initialize: function(name, options) {
    183183        var url = get_balanced_urls('{{ settings.DJANGO_CDN_DOMAINS_PROTOCOL }}', {{ settings.DJANGO_CDN_DOMAINS|safe }},
    184           '{{ settings.DJANGO_PREFIX }}/wlheatmap/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__organization__name__startswith=Wireless');
     184          '{{ settings.DJANGO_PREFIX }}/wlheatmap/tile/${z}/${x},${y}.png?colour=255,0,0&accesspoint__organization__name__startswith=Wireless');
    185185        options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
    186186        var newArguments = [name, url, options];
Note: See TracChangeset for help on using the changeset viewer.