mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 15:21:52 +00:00
documenting fossils
This commit is contained in:
parent
42b615d16b
commit
4c7deadb9a
@ -20,12 +20,14 @@ What is the search path for the css and js inclusions in the Media subclasses t
|
|||||||
class TroggleModelAdmin(admin.ModelAdmin):
|
class TroggleModelAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
"""overriding admin save to fill the new_since parsing_field"""
|
"""overriding admin save to fill the new_since parsing_field
|
||||||
|
|
||||||
|
new_since_parsing is not currently used in troggle. It is a fossil."""
|
||||||
obj.new_since_parsing=True
|
obj.new_since_parsing=True
|
||||||
obj.save()
|
obj.save()
|
||||||
|
|
||||||
class Media:
|
class Media:
|
||||||
js = ('jquery/jquery.min.js','js/QM_helper.js')
|
js = ('jquery/jquery.min.js','js/QM_helper.js') # not currently available to troggle, see media/js/README
|
||||||
|
|
||||||
|
|
||||||
class RoleInline(admin.TabularInline):
|
class RoleInline(admin.TabularInline):
|
||||||
@ -37,11 +39,6 @@ class SurvexBlockAdmin(TroggleModelAdmin):
|
|||||||
inlines = (RoleInline,)
|
inlines = (RoleInline,)
|
||||||
|
|
||||||
|
|
||||||
# class SurveyAdmin(TroggleModelAdmin):
|
|
||||||
# #inlines = (ScannedImageInline,)
|
|
||||||
# search_fields = ('expedition__year','wallet_number')
|
|
||||||
|
|
||||||
|
|
||||||
class QMsFoundInline(admin.TabularInline):
|
class QMsFoundInline(admin.TabularInline):
|
||||||
model=QM
|
model=QM
|
||||||
fk_name='found_by'
|
fk_name='found_by'
|
||||||
|
@ -90,6 +90,8 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}):
|
|||||||
The checking is accomplished using Django's get_or_create and the new_since_parsing boolean field
|
The checking is accomplished using Django's get_or_create and the new_since_parsing boolean field
|
||||||
defined in core.models.TroggleModel.
|
defined in core.models.TroggleModel.
|
||||||
|
|
||||||
|
We are not using new_since_parsing - it is a fossil from Aaron Curtis's design in 2006. So it is always false.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
instance, created = objectType.objects.get_or_create(defaults=nonLookupAttribs, **lookupAttribs)
|
instance, created = objectType.objects.get_or_create(defaults=nonLookupAttribs, **lookupAttribs)
|
||||||
@ -116,10 +118,10 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}):
|
|||||||
logging.info(str(instance) + ' was just added to the database for the first time. \n')
|
logging.info(str(instance) + ' was just added to the database for the first time. \n')
|
||||||
|
|
||||||
if not created and instance.new_since_parsing:
|
if not created and instance.new_since_parsing:
|
||||||
logging.info(str(instance) + " has been modified using Troggle, so the current script left it as is. \n")
|
logging.info(str(instance) + " has been modified using Troggle since parsing, so the current script left it as is. \n")
|
||||||
|
|
||||||
if not created and not instance.new_since_parsing:
|
if not created and not instance.new_since_parsing:
|
||||||
logging.info(str(instance) + " existed in the database unchanged since last parse. It was overwritten by the current script. \n")
|
logging.info(" instance:<"+ str(instance) + "> existed in the database unchanged since last parse. It have been overwritten.")
|
||||||
return (instance, created)
|
return (instance, created)
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ This folder is NOT LINKED IN TO troggle
|
|||||||
|
|
||||||
ONLY mention of QM_helper and jquery is in core/admin.py
|
ONLY mention of QM_helper and jquery is in core/admin.py
|
||||||
where it is something to do with the JSON export capability.
|
where it is something to do with the JSON export capability.
|
||||||
Which seems to work even though /js/ is not availabl to troggle code
|
Which seems to work even though /js/ is not available to troggle code
|
||||||
(it woud need to be /javascript/...)
|
(it woud need to be /javascript/...)
|
||||||
|
|
||||||
settings.JSLIB_URL == /JAVASCRIPT/
|
settings.JSLIB_URL == /JAVASCRIPT/
|
||||||
|
Loading…
Reference in New Issue
Block a user