Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2011 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1204254 to your computer and use it in GitHub Desktop.
Save anonymous/1204254 to your computer and use it in GitHub Desktop.
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