Created
June 20, 2012 07:48
-
-
Save norrs/2958684 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nav.models.rrd import RrdDataSource | |
datasources = RrdDataSource.objects.filter(rrd_file__key='interface').select_related('rrd_file') | |
datasource_loookup = {} | |
for data in datasources: | |
interface = int(data.rrd_file.value) | |
if interface in datasource_loookup: | |
datasource_loookup[interface].append(data) | |
else: | |
datasource_loookup.update( {interface: [data] } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment