def create_resource(resource_type, longitude, latitude, name, info, swe_name, swe_info): resource = Resource(resource_type=resource_type) resource.longitude = longitude resource.latitude = latitude resource.translate('en') resource.name = name resource.specific_information = info resource.save() resource.translate('sv') resource.name = swe_name resource.specific_information = swe_info resource.save() return resource
def create_resource(resource_type): resource_id = Resource.objects.filter( resource_type=resource_type).count() + 1 resource = Resource(resource_type=resource_type) resource.longitude = resource_id + 100 + resource_id resource.latitude = resource_id + 100 + resource_id resource.translate('en') resource.name = 'english resource name %s' % resource_id resource.specific_information = 'english resource info %s' % resource_id resource.save() resource.translate('sv') resource.name = 'swedish resource name %s' % resource_id resource.specific_information = 'swedish resource info %s' % resource_id resource.save() return resource
def create_resource(resource_type): resource_id = Resource.objects.filter(resource_type=resource_type).count() + 1 resource = Resource(resource_type=resource_type) resource.longitude = resource_id + 100 + resource_id resource.latitude = resource_id + 100 + resource_id resource.translate('en') resource.name = 'english resource name %s' % resource_id resource.specific_information = 'english resource info %s' % resource_id resource.save() resource.translate('sv') resource.name = 'swedish resource name %s' % resource_id resource.specific_information = 'swedish resource info %s' % resource_id resource.save() return resource