Changeset 9395 for src


Ignore:
Timestamp:
Jul 12, 2011, 3:28:05 PM (13 years ago)
Author:
rick
Message:

We might as well want to store the results in the Django instance as well. Save some other hacks.

Location:
src/django_gheat
Files:
1 added
3 edited

Legend:

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

    r9054 r9395  
    1 from gheat.models import Accespoint, Apparatuur, Gebruiker, MeetRondje, Meting
     1from gheat.models import Accespoint, Apparatuur, Gebruiker, MeetRondje, Meting, MeetBestand
    22from django.contrib import admin
    33
     
    55admin.site.register(Apparatuur)
    66admin.site.register(Gebruiker)
    7 admin.site.register(MeetRondje)
     7class MeetBestandInline(admin.TabularInline):
     8  model = MeetBestand
     9class MeetRondjeAdmin(admin.ModelAdmin):
     10  inlines = [ MeetBestandInline, ]
     11
     12admin.site.register(MeetRondje, MeetRondjeAdmin)
    813admin.site.register(Meting)
  • src/django_gheat/gheat/models.py

    r9245 r9395  
    8080    return "%s - %s" % (self.gebruiker.naam, self.naam)
    8181
     82class MeetBestand(models.Model):
     83  meetrondje = models.ForeignKey(MeetRondje)
     84  bestand = models.FileField(upload_to='meet-bestand/%Y/%m/%d')
     85 
     86
    8287class Meting(models.Model):
    8388  meetrondje = models.ForeignKey(MeetRondje)
  • src/django_gheat/settings.py

    r9394 r9395  
    5959# Absolute path to the directory that holds media.
    6060# Example: "/home/media/media.lawrence.com/"
    61 MEDIA_ROOT = ''
     61MEDIA_ROOT = os.path.join(PROJECT_HOME,'sitemedia')
     62
    6263
    6364# URL that handles the media served from MEDIA_ROOT. Make sure to use a
    6465# trailing slash if there is a path component (optional in other cases).
    6566# Examples: "http://media.lawrence.com", "http://example.com/media/"
    66 MEDIA_URL = ''
    67 
    68 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
    69 # trailing slash.
    70 # Examples: "http://foo.com/media/", "/media/".
    71 ADMIN_MEDIA_PREFIX = '/media/'
     67MEDIA_URL = '/media/'
    7268
    7369# Absolute path to the directory static files should be collected to.
     
    7571# in apps' "static/" subdirectories and in STATICFILES_DIRS.
    7672# Example: "/home/media/media.lawrence.com/static/"
    77 STATIC_ROOT = 'sitestatic'
     73STATIC_ROOT =  os.path.join(PROJECT_HOME,'sitestatic')
    7874
    7975# URL prefix for static files.
Note: See TracChangeset for help on using the changeset viewer.