Created
January 22, 2015 18:33
-
-
Save GaretJax/4ccaf1963314d4754f64 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 optparse import make_option | |
from django.core.management.base import BaseCommand | |
from products.models import SupplierOpportunity | |
class Command(BaseCommand): | |
def handle(self, *args, **options): | |
objs = SupplierOpportunity.objects.raw(""" | |
SELECT | |
Id,Name, | |
Account__c, | |
Contact__c, | |
Contact_Name__c, | |
Contact_Typ__c, | |
Kontaktperson__c, | |
Opportunity__c, | |
Opportunity_Name__c, | |
Opportuniy_PLZ__c, | |
SortOrder_Default__c, | |
Status__c, | |
CreatedById, | |
LastModifiedById, | |
CreatedDate, | |
Verkaufspreis__c, | |
Opportunity_Leadbeschreibung__c, | |
Opportunity_Kontaktdaten_Lead__c | |
FROM Opportunity_Supplier__c | |
WHERE | |
Account__c = %s | |
AND Opportunity__c.Stage != \'Verloren und Geschlossen\' | |
""", ['0011100000ddDnEAAU']) | |
print len(list(objs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment