Esempio n. 1
0
 class Arguments:
     name = graphene.String()
     sprite = graphene.String()
     speed = graphene.Decimal()
     hitboxSize = graphene.Decimal()
     damage = graphene.Int()
     range = graphene.Decimal()
Esempio n. 2
0
class BoatNode(DjangoObjectType):
    owner = graphene.Field("customers.schema.ProfileNode", required=True)
    certificates = graphene.List("customers.schema.BoatCertificateNode",
                                 required=True)
    length = graphene.Decimal(required=True)
    width = graphene.Decimal(required=True)
    draught = graphene.Decimal()

    class Meta:
        model = Boat
        interfaces = (relay.Node, )
        connection_class = CountConnection

    def resolve_certificates(self, info):
        return self.certificates.all()

    @classmethod
    @login_required
    def get_queryset(cls, queryset, info):
        user = info.context.user
        return return_queryset_if_user_has_permissions(
            queryset,
            user,
            Boat,
            CustomerProfile,
            customer_queryset=queryset.filter(owner__user=user),
        )

    @classmethod
    @login_required
    def get_node(cls, info, id):
        node = super().get_node(info, id)
        return return_node_if_user_has_permissions(node, info.context.user,
                                                   Boat, CustomerProfile)
class BaseUpdateApplicationInput:
    id = graphene.ID(required=True)
    customer_id = graphene.ID()
    language = graphene.String()
    first_name = graphene.String()
    last_name = graphene.String()
    email = graphene.String()
    phone_number = graphene.String()
    address = graphene.String()
    zip_code = graphene.String()
    municipality = graphene.String()
    company_name = graphene.String()
    business_id = graphene.String()
    boat_type = graphene.ID()
    boat_registration_number = graphene.String()
    boat_name = graphene.String()
    boat_model = graphene.String()
    boat_length = graphene.Decimal()
    boat_width = graphene.Decimal()
    application_code = graphene.String()
    accept_boating_newsletter = graphene.Boolean()
    accept_fitness_news = graphene.Boolean()
    accept_library_news = graphene.Boolean()
    accept_other_culture_news = graphene.Boolean()
    boat_draught = graphene.Decimal()
    boat_weight = graphene.Decimal()
Esempio n. 4
0
class PurchaseQuery(graphene.ObjectType):
    purchase = graphene.Field(
        PurchaseType,
        purchase_value=graphene.Decimal(required=True),
        reseller=graphene.String(required=True),
        code=graphene.String(),
        date_purchase=graphene.Date(),
        cashback_credit_value=graphene.Decimal(),
        status=graphene.String(),
        created_at=graphene.Date(),
        update_at=graphene.Date(),

    )

    # all_purchase = graphene.List(PurchaseType, token=graphene.String(required=True))
    all_purchase = graphene.List(PurchaseType, token=graphene.String(required=False))

    def resolve_all_purchase(self, info, **kwargs):
        return Purchase.objects.all()

    def resolve_purchase(self, info, **kwargs):
        id = kwargs.get('id')
        if id:
            return Purchase.objects.get(pk=id)

        return None
Esempio n. 5
0
 class Arguments:
     id = graphene.Int(required=True)
     username = graphene.String()
     email = graphene.String()
     password = graphene.String()
     latitude = graphene.Decimal()
     longitude = graphene.Decimal()
Esempio n. 6
0
 class Input:
     provider_id = graphene.ID(required=True)
     symbol = graphene.String(required=True)
     margin = graphene.Decimal()
     price = graphene.Decimal()
     quantity = graphene.Int()
     account_id = graphene.ID()
Esempio n. 7
0
 class Input:
     id = graphene.ID(required=True)
     min_width = graphene.Decimal()
     max_width = graphene.Decimal()
     tier_1_price = graphene.Decimal()
     tier_2_price = graphene.Decimal()
     tier_3_price = graphene.Decimal()
Esempio n. 8
0
	class Arguments:
		gender = graphene.String()
		about_me = graphene.String()
		about_family = graphene.String()
		dob = graphene.DateTime()
		profile_created_by = graphene.String()
		country = graphene.String()
		city = graphene.String()
		state = graphene.String()
		work_location = graphene.String()
		native_location = graphene.String()
		gothram = graphene.String()
		college = graphene.String()
		height = graphene.Decimal()
		weight = graphene.Decimal()
		physical_status = graphene.String()
		body_type = graphene.String()
		eating_habits = graphene.String()	    
		drinking_habits = graphene.String()
		smoking_habits = graphene.String()
		mother_tongue = graphene.String()
		religion = graphene.String()
		caste = graphene.String()
		raasi = graphene.String()
		sub_caste = graphene.String()
		star = graphene.String()
		highest_education = graphene.String()
		employed_in = graphene.String()
		occupation =  graphene.String()
		dosham = graphene.String()
Esempio n. 9
0
 class Arguments:
     runtype = graphene.String(required=True)
     date = graphene.Date(required=True)
     units = graphene.String(required=True)
     distance = graphene.Decimal(required=True)
     duration = graphene.Decimal(required=True)
     avg_HR = graphene.Int()
     notes = graphene.String()
Esempio n. 10
0
 class Input:
     provider_id = graphene.ID(required=True)
     strategy_id = graphene.ID(required=True)
     symbol = graphene.String(required=True)
     margin = graphene.Decimal()
     price = graphene.Decimal()
     quantity = graphene.Int()
     account_id = graphene.ID()
     autopilot = graphene.Boolean()
 class Input:
     finance_invoice = graphene.ID(required=True)
     product_name = graphene.String(required=False, default_value="")
     description = graphene.String(required=False, default_value="")
     quantity = graphene.Decimal(required=False, default_value=Decimal(0))
     price = graphene.Decimal(required=False, default_value=Decimal(0))
     finance_tax_rate = graphene.ID(required=False, default_value=None)
     finance_glaccount = graphene.ID(required=False)
     finance_costcenter = graphene.ID(required=False)
Esempio n. 12
0
class BaseFarmInput(graphene.InputObjectType):
    name = graphene.String(description=_('Name of the farm'))
    slug = graphene.String(description=_('Slug identifier for farm'))
    ph = graphene.Decimal(description=_('pH of farm soil'))
    speed = graphene.Int(description=_('Wind speed of farm'))
    temperature = graphene.Decimal(description=_('Temperature of farm'))
    humidity = graphene.Int(description=_('Humidity of farm environment'))
    pressure = graphene.Int(description=_('Pressure of soil'))
    soil_content = graphene.Int(description=_('Soil water content'))
Esempio n. 13
0
class QuoteType(graphene.ObjectType):
    volume = graphene.Int()
    last = graphene.Decimal()
    bid = graphene.Decimal()
    ask = graphene.Decimal()
    last_trade_direction = graphene.Decimal()
    market_cap = graphene.Decimal()
    shares_outstanding = graphene.Int()
    primary_exchange = graphene.String()
    company_name = graphene.String()
Esempio n. 14
0
 class Arguments:
     warehouseid = graphene.Int(required=True)
     productid = graphene.Int(required=True)
     qty = graphene.Decimal(required=True)
     price = graphene.Decimal(required=True)
     pricetypeid = graphene.Int(required=True)
     discountid = graphene.Int(required=True)
     tracknumber = graphene.String(required=True)
     statusid = graphene.Int(required=True)
     notes = graphene.String()
 class Input:
     id = graphene.ID(required=True)
     line_number = graphene.Int(required=False)
     product_name = graphene.String(required=False)
     description = graphene.String(required=False)
     quantity = graphene.Decimal(required=False)
     price = graphene.Decimal(required=False)
     finance_tax_rate = graphene.ID(required=False)
     finance_glaccount = graphene.ID(required=False)
     finance_costcenter = graphene.ID(required=False)
Esempio n. 16
0
class GeoDistance(graphene.InputObjectType):
    """Geo distance.

        filter:[
            {place: {geoDistance: {distance: "9km", lat: "40.0", lon="70.0"}}}
        ]
    """

    distance = graphene.String(required=True)
    lat = graphene.Decimal(required=True)
    lon = graphene.Decimal(required=True)
Esempio n. 17
0
 def Mutations(root, info, brawler, isSuper, name, description, reloadSpeed,
               attackSpeed, projectilPattern):
     ability = Ability(brawler=brawler,
                       isSuper=isSuper,
                       name=name,
                       description=graphene.String(),
                       image=graphene.String(),
                       reloadSpeed=graphene.Decimal(),
                       attackSpeed=graphene.Decimal(),
                       projectilPattern=projectilPattern())
     ok = True
     return CreateAbility(person=ability, ok=ok)
Esempio n. 18
0
 class Arguments:
     name = graphene.String(required=True)
     description = graphene.String()
     subcategory_id = graphene.Int(required=True)
     state = graphene.String()
     tag = graphene.String()
     price_old = graphene.Decimal()
     discount = graphene.Decimal()
     quantity = graphene.Int()
     active = graphene.Boolean()
     featured = graphene.Boolean()
     product_owner_id = graphene.Int(required=True)
Esempio n. 19
0
class EditRun(graphene.Mutation):
    id = graphene.ID()
    runtype = graphene.String()
    date = graphene.Date()
    units = graphene.String()
    distance = graphene.Decimal()
    pace = graphene.Decimal()
    duration = graphene.Decimal()
    avg_HR = graphene.Int()
    notes = graphene.String()
    user = graphene.Field(UserType)

    class Arguments:
        id = graphene.ID(required=True)
        runtype = graphene.String(required=True)
        date = graphene.Date(required=True)
        units = graphene.String(required=True)
        distance = graphene.Decimal(required=True)
        duration = graphene.Decimal(required=True)
        avg_HR = graphene.Int()
        notes = graphene.String()

    @login_required
    def mutate(self, info, id, runtype, date, units, distance, duration, avg_HR, notes):
        run = Run.objects.get(pk=id)
        user = info.context.user

        if not user == run.user:
            raise Exception('Not authorised to edit this.')

        run.runtype = runtype
        run.date = date
        run.units = units
        run.distance = distance
        run.duration = duration
        run.pace = duration / distance
        run.avg_HR = avg_HR
        run.notes = notes
        run.save()

        return EditRun(
            id=run.id,
            runtype=run.runtype,
            date=run.date,
            units=run.units,
            distance=run.distance,
            pace=run.pace,
            duration=run.duration,
            avg_HR=run.avg_HR,
            notes=run.notes,
            user=run.user
        )
class BoatInput:
    boat_type_id = graphene.ID()
    registration_number = graphene.String()
    name = graphene.String()
    model = graphene.String()
    length = graphene.Decimal()
    width = graphene.Decimal()
    draught = graphene.Decimal()
    weight = graphene.Int()
    propulsion = graphene.String()
    hull_material = graphene.String()
    intended_use = graphene.String()
    add_boat_certificates = graphene.List(AddBoatCertificateInput)
Esempio n. 21
0
class WorkoutType(DjangoObjectType):
    exercise_count = graphene.Int()
    total_weight = graphene.Decimal()

    class Meta:
        model = Workout

    @staticmethod
    def resolve_exercise_count(workout, info):
        return workout.exercises.count()

    @staticmethod
    def resolve_total_weight(workout, info):
        """
        Sum of weight moved in workout sets
        """

        exercises = workout.exercises.filter(is_active=True).values("id")
        sets = (Set.objects.filter(
            exercise__in=exercises,
            is_active=True).values("repetitions", "weight", "unit").exclude(
                repetitions__isnull=True).exclude(weight__isnull=True))

        if sets:
            return sum([
                s["repetitions"] * convert_to_lbs(s["weight"], s["unit"])
                for s in sets
            ])

        return Decimal(0)
Esempio n. 22
0
 class Arguments:
     mouldId = graphene.String(required=True)
     name = graphene.String()
     company = graphene.String()
     part = graphene.String()
     cavity = graphene.Int()
     runnerWeight = graphene.Decimal()
Esempio n. 23
0
class AccountInput(graphene.InputObjectType):
    name = graphene.String(required=True)
    type = graphene.String(required=True)
    institution = graphene.String(required=True)
    description = graphene.String(required=False)
    amount = graphene.Decimal(required=False)
    number = graphene.String(required=False)
Esempio n. 24
0
 class Input:
     name = graphene.String(required=True)
     description = graphene.String(required=True)
     pictures = graphene.List(Upload, required=True)
     quantity = graphene.Int()
     price = graphene.Decimal(required=True)
     store_id = graphene.ID(required=True)
Esempio n. 25
0
 class Input:
     name = graphene.String(required=True)
     description = graphene.String(required=True)
     logo = Upload()
     cover = Upload()
     closed = graphene.Boolean(default_value=False)
     shipping = graphene.Decimal(required=True)
 class Input:
     finance_invoice = graphene.ID(required=True)
     date = graphene.types.datetime.Date(required=True)
     amount = graphene.Decimal(required=True)
     finance_payment_method = graphene.ID(required=False,
                                          default_value=None)
     note = graphene.String(required=False, default_value="")
 class Input:
     account_subscription = graphene.ID(required=True)
     subscription_year = graphene.Int(required=True)
     subscription_month = graphene.Int(required=True)
     amount = graphene.Decimal(required=False, default_value=0)
     description = graphene.String(required=False, default_value="")
     note = graphene.String(required=False, default_value="")
Esempio n. 28
0
class ContractAmendInputType(OpenIMISMutation.Input):
    id = graphene.UUID(required=True)
    amount_notified = graphene.Decimal(max_digits=18,
                                       decimal_places=2,
                                       required=False)
    amount_rectified = graphene.Decimal(max_digits=18,
                                        decimal_places=2,
                                        required=False)
    amount_due = graphene.Decimal(max_digits=18,
                                  decimal_places=2,
                                  required=False)
    date_approved = graphene.DateTime(required=False)
    date_payment_due = graphene.Date(required=False)
    payment_reference = graphene.String(required=False)
    date_valid_to = graphene.Date(required=False)
    json_ext = graphene.types.json.JSONString(required=False)
Esempio n. 29
0
class MenuItemInput(graphene.InputObjectType):
    internal_name = graphene.String()
    picture = graphene.Field(lambda: ImageField)
    price = graphene.Decimal()
    quantity = graphene.String()
    allergens = graphene.String()
    category = graphene.String()
Esempio n. 30
0
 class Arguments:
     # Input arguments for this mutation
     id = graphene.ID(required=True)
     budget_id = graphene.ID(required=False)
     product_id = graphene.ID(required=False)
     quantity = graphene.Int()
     price = graphene.Decimal(required=False)