Created
September 8, 2011 18:42
-
-
Save anonymous/1204254 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 seo.models import jobListing | |
from directseo.serializers import XMLExtraSerializer | |
def get_data_from_xmlextraserializer(): | |
host = 'find.ibm.jobs' | |
jobs = jobListing.objects.filter(buid__id=2432,country_short='MEX') | |
s = XMLExtraSerializer([{'name':'url', 'type':'CharField'}]) | |
data = s.serialize( | |
jobs.extra( | |
select={"url":'concat("http://", "%s",id,"/job?utm_source=xml&utm_medium=feed")' %host} | |
), | |
fields( | |
'title', | |
'url', | |
'country', | |
'country_short', | |
'state', | |
'state_short', | |
'city', | |
'location', | |
'date_new', | |
'description', | |
'reqid') | |
) | |
return data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment