Assign Uber driver to particular restaurant?

I have couple of restaurant in same town and would like to know if I can designate one driver so my store always gets Uber driver? In current case since there are less driver available in town I do not get Uber eats order. But, If I can able to designate or give priority to my stores then I can sign up for Uber Eats driver and set it for my stores only.

Thank You,

Assign Uber driver to particular restaurant?

I have couple of restaurant in same town and would like to know if I can designate one driver so my store always gets Uber driver? In current case since there are less driver available in town I do not get Uber eats order. But, If I can able to designate or give priority to my stores then I can sign up for Uber Eats driver and set it for my stores only.

Thank You,

ValueError: Cannot assign “‘1′”: “User.campus” must be a “Campus” instance. Erro no cadastro de Super Usuário no Django

Estou desenvolvendo uma aplicação onde o usuário necessita estar em um campus. Porem quando se cria o ‘superuser’ no terminal ocorre um erro de instância.

Obs: O banco de dados esta corretamente pre-preenchido para buscar o ‘campus_id’.

Django 2.0.4 e python3.6

Erro

contas/models.py

class UserManager(BaseUserManager):  def _create_user(self, email, matricula, password, is_staff, is_superuser, **extra_fields):     now = timezone.now()     if not matricula:         raise ValueError(_('The given matricula must be set'))     email = self.normalize_email(email)     user = self.model(matricula=matricula, email=email, is_staff=is_staff, is_active=True, is_superuser=is_superuser, last_login=now, date_joined=now, **extra_fields)     user.set_password(password)     user.save(using=self._db)     return user  def create_user(self, matricula, email=None, password=None, **extra_fields):     return self._create_user(matricula, email, password, False, False, **extra_fields)  def create_superuser(self, matricula, email, password, **extra_fields):     user=self._create_user(matricula, email, password, True, True, **extra_fields)     user.is_active=True     user.save(using=self._db)     return user  class User(AbstractBaseUser, PermissionsMixin):  username = models.CharField(_('username'), max_length=15, unique=True,     help_text=_('Required. 15 characters or fewer. Letters, numbers and @/./+/-/_ characters'),     validators=[ validators.RegexValidator(re.compile('^[\w.@+-]+$  '), _('Enter a valid username.'),      _('invalid'))], blank=True, null=True) name = models.CharField(_('Nome'), max_length=100, null=True, blank=True) email = models.EmailField(_('email address'), max_length=100, unique=True) is_staff = models.BooleanField(_('staff status'), default=False, help_text=_('Designates whether the user can log into this admin site.')) is_active = models.BooleanField(_('active'), default=True, help_text=_('Designates whether this user should be treated as active. Unselect this instead of deleting accounts.')) is_trusty = models.BooleanField(_('trusty'), default=False, help_text=_('Designates whether this user has confirmed his account.')) date_joined = models.DateTimeField(_('date joined'), auto_now_add=True) matricula = models.CharField(     'Matricula', max_length=25, unique=True) tipo = models.IntegerField(choices = ((1, 'Docente'),                                 (2, 'Discente'),                                 (3, 'Técnico Administrativo')), default=1) campus = models.ForeignKey(Campus, on_delete=models.PROTECT) cpf = models.CharField(max_length=30, unique=True, null=True, blank=True)  USERNAME_FIELD = 'matricula' REQUIRED_FIELDS = ['name', 'email', 'tipo', 'cpf', 'campus']  objects = UserManager()  class Meta:     verbose_name = _('user')     verbose_name_plural = _('users')  def get_full_name(self):     full_name = '%s %s' % (self.name, self.name)     return full_name.strip() def get_short_name(self):     return self.name def email_user(self, subject, message, from_email=None):     send_mail(subject, message, from_email, [self.email]) 

settings.py

AUTH_USER_MODEL = 'contas.User' 

instituicoes/models.py

class Instituicao(models.Model): nome = models.CharField(max_length=70, null=False, blank=False) razao_social = models.CharField(max_length=100, null=False, blank=False) cnpj = models.CharField(max_length=30, null=False, blank=False) sigla = models.CharField(max_length=10, null=False, blank=False) estado = models.ForeignKey(Estado, on_delete=models.PROTECT, blank=True)  def __str__(self):     return self.sigla  class Meta:     verbose_name = 'Instituição'     verbose_name_plural = 'Instituições'   class Campus(models.Model): nome = models.CharField(max_length=50, null=False) sigla = models.CharField(max_length=10, null=False) endereco = models.ForeignKey(Endereco, on_delete=models.PROTECT) instituicao = models.ForeignKey(Instituicao, on_delete=models.PROTECT) ddd_telefone = models.CharField(max_length=2, null=False) telefone = models.CharField(max_length=9, null=False)  def __str__(self):     return self.nome  class Meta:     verbose_name = 'Campus'     verbose_name_plural = 'Campi' 

How to assign a data range into specific values?

I’ve approached a weird issue on Google sheets. My sheet scheme looks more less like that:

NAME | NUMBER OF PEOPLE | RANGE ABC  | 34               | 21-50 FYZ  | 101              | 101-150  etc. 

My fixed ranges are as follows:
1-10, 11-20, 21-50, 51-100,101-150,151-200,201-300,301 and more

How I can check in a single formula such a thing without multiple if’s? I’ve tried with a vlookup but have no clue how to finalize that.

How to assign a private IP dynamically generated with AWS Cloudformation?

I have an AWS Cloudformation, and I want two EC2 instances A and B on a private subnet under the same VPC.
In the application, I need A to access B.
How can I configure A with the dynamically allocated private IP of B?

I believe I can configure A with an environment variable (e.g., with aws:elasticbeanstalk:application:environment).
The problem is that I don’t know how to get the IP of B. I assume it cannot be an elastic IP because it’s private, hence it may be changed between deployments.

Assign guest order to customer Magento 1.9

I want to assign a quest order to a customer, using a custom script. I tried the following, do not get any error, but it is not assigned.

What am I missing?

CODE:

<?php  ini_set('display_errors', 'On'); error_reporting(E_ALL);   require('../app/Mage.php'); // this is assuming your script is located in the Magento root dir Mage::app();  $  toCustomer = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($  customerEmail); $  orderbyid = Mage::getModel('sales/order')->loadByIncrementId('123456');  $  orderbyid->setCustomerId($  toCustomer->getId());  $  orderbyid->setCustomerFirstname($  toCustomer->getFirstname());  $  orderbyid->setCustomerLastname($  toCustomer->getLastname());  $  orderbyid->setCustomerEmail($  toCustomer->getEmail()); $  orderbyid->save();  ?> 

Magento2 impossible assign products to categories

SQLSTATE[HY000]: General error: 1114 The table 'catalog_category_product_index_tmp' is full, query was: INSERT INTO `catalog_category_product_index_tmp` (`category_id`, `product_id`, `position`, `is_parent`, `store_id`, `visibility`) SELECT 2 AS `category_id`, `cp`.`entity_id` AS `product_id`, IF(ccp.product_id IS NOT NULL, ccp.position, 0) AS `position`, IF(ccp.product_id IS NOT NULL, 1, 0) AS `is_parent`, 10 AS `store_id`, IFNULL(cpvs.value, cpvd.value) AS `visibility` FROM `catalog_product_entity` AS `cp` INNER JOIN `catalog_product_website` AS `cpw` ON cpw.product_id = cp.entity_id INNER JOIN `catalog_product_entity_int` AS `cpsd` ON cpsd.entity_id = cp.entity_id AND cpsd.store_id = 0 AND cpsd.attribute_id = 97 LEFT JOIN `catalog_product_entity_int` AS `cpss` ON cpss.entity_id = cp.entity_id AND cpss.attribute_id = cpsd.attribute_id AND cpss.store_id = 10 INNER JOIN `catalog_product_entity_int` AS `cpvd` ON cpvd.entity_id = cp.entity_id AND cpvd.store_id = 0 AND cpvd.attribute_id = 99 LEFT JOIN `catalog_product_entity_int` AS `cpvs` ON cpvs.entity_id = cp.entity_id AND cpvs.attribute_id = cpvd.attribute_id AND cpvs.store_id = 10 LEFT JOIN `catalog_category_product` AS `ccp` ON ccp.product_id = cp.entity_id WHERE (cpw.website_id = '1') AND (IFNULL(cpss.value, cpsd.value) = 1) AND (IFNULL(cpvs.value, cpvd.value) IN (2, 3, 4)) AND (cp.entity_id IN ('70473', '70478')) GROUP BY `cp`.`entity_id` ON DUPLICATE KEY UPDATE `category_id` = VALUES(`category_id`), `product_id` = VALUES(`product_id`), `position` = VALUES(`position`), `is_parent` = VALUES(`is_parent`), `store_id` = VALUES(`store_id`), `visibility` = VALUES(`visibility`) 

Any help how to solve?