long
parent
c8a76cc925
commit
5eee020da0
|
@ -102,13 +102,13 @@ def ip_to_long(value):
|
|||
validators.validate_integer(value[i])
|
||||
lower_validator(value[i])
|
||||
upper_validator(value[i])
|
||||
output += long(value[i]) * (256**(3-i))
|
||||
output += int(value[i]) * (256**(3-i))
|
||||
|
||||
return output
|
||||
|
||||
def long_to_ip(value):
|
||||
validators.validate_integer(value)
|
||||
value = long(value)
|
||||
value = int(value)
|
||||
|
||||
validators.MinValueValidator(0)(value)
|
||||
validators.MaxValueValidator(4294967295)(value)
|
||||
|
|
|
@ -9,7 +9,7 @@ def libname(value):
|
|||
returns library name .
|
||||
"""
|
||||
try:
|
||||
vl = long(value)
|
||||
vl = int(value)
|
||||
lib = models.Library.objects.get(pk=vl)
|
||||
return lib.__str__()
|
||||
except models.Library.DoesNotExist:
|
||||
|
|
|
@ -58,14 +58,14 @@ def marc_records(request, selected_records=None):
|
|||
elif hasattr(record_name, 'edition'):
|
||||
record = models.MARCRecord(edition=record_name.edition)
|
||||
elif record_name.startswith('edition_'):
|
||||
record_id = long(record_name[8:])
|
||||
record_id = int(record_name[8:])
|
||||
try:
|
||||
edition = Edition.objects.get(pk=record_id)
|
||||
except Edition.DoesNotExist:
|
||||
continue
|
||||
record = models.MARCRecord(edition=edition)
|
||||
elif record_name.startswith('record_'):
|
||||
record_id = long(record_name[7:])
|
||||
record_id = int(record_name[7:])
|
||||
try:
|
||||
record = models.MARCRecord.objects.get(id=record_id )
|
||||
except models.MARCRecord.DoesNotExist:
|
||||
|
|
Loading…
Reference in New Issue