def show(self): CrudView.show(self) self.output['object'][ 'Yayınlanmış mı?'] = 'Evet' if self.object.yayinlanmis_mi else 'Hayır' form = JsonForm() form.tamam = fields.Button(_(u"Tamam")) self.form_out(form)
def list(self, custom_form=None): self.current.task_data.pop('object_id', None) custom_form = JsonForm(current=self.current, title=_(u"Gündem Listesi")) custom_form.ekle = fields.Button(_(u"Yeni Gündem Oluştur"), cmd='yeni_gundem') CrudView.list(self, custom_form=custom_form)
def list(self, custom_form=None): if 'form' in self.input and 'proje' in self.input['form']: self.current.task_data['bap_proje_id'] = self.input['form'][ 'proje'] CrudView.list(self) proje = BAPProje.objects.get(self.current.task_data['bap_proje_id']) if 'GenelBilgiGirForm' in self.current.task_data: ad = self.current.task_data['GenelBilgiGirForm']['ad'] else: ad = proje.ad toplam = sum( BAPButcePlani.objects.all( ilgili_proje=proje).values_list('toplam_fiyat')) self.output['objects'].append({ 'fields': ['TOPLAM', '', '', '', '', str(toplam), ''], 'actions': '' }) form = JsonForm(title=_(u"%s projesi için Bütçe Planı") % ad) form.ekle = fields.Button(_(u"Ekle"), cmd='add_edit_form') form.sartname_ekle = fields.Button(_(u"Teknik Şartname Ekle"), cmd='sartname_ekle') form.bitir = fields.Button(_(u"Bitir"), cmd='bitir') self.form_out(form)
def __init__(self, current): CrudView.__init__(self, current) if 'object_id' in self.current.task_data and self.cmd == 'add_edit_form' and \ 'object_id' not in self.input: del self.current.task_data['object_id'] self.object = BAPSSS() self.object_form = SSSAddEditForm(self.object, current=self.current)
def __init__(self, current): CrudView.__init__(self, current) if 'object_id' in self.current.task_data and self.cmd == 'add_edit_form' and \ 'object_id' not in self.input: del self.current.task_data['object_id'] self.object = BAPIsPaketi() if 'iptal' in current.task_data['cmd'] and 'IsPaketiHazirlaForm' in self.current.task_data: del current.task_data['IsPaketiHazirlaForm']
def show(self): CrudView.show(self) self.output['object']['Muhasebe Kod'] = str( self.object.muhasebe_kod_genel) self.output['object'][ 'Teknik Şartname'] = self.object.teknik_sartname.aciklama form = JsonForm() form.tamam = fields.Button(_(u"Tamam")) self.form_out(form)
def add_edit_form(self): if 'kontrol_msg' in self.current.task_data: msg = _(u"%s") % self.current.task_data['kontrol_msg'] self.current.output['msgbox'] = { "type": "warning", "title": _(u"Hatalı Veri Girişi"), "msg": msg } del self.current.task_data['kontrol_msg'] self.set_form_data_to_object() CrudView.add_edit_form(self)
def __init__(self, current): CrudView.__init__(self, current) if not self.object.key: self.object = self.model_class.objects.get( self.current.task_data.get('bap_proje_id', self.input.pop('object_id', ''))) self.current.output["meta"]["allow_search"] = False # Genel form, bu nesneyi extend eden digerleri tarafindan degistirilebilsin # bkz: bap_ogrbasvuru_goruntule.py self.genel_form = GenelProjeForm
def show(self): CrudView.show(self) form = JsonForm() form.tamam = fields.Button(_(u"Tamam")) self.form_out(form) self.output['object_title'] = _(u"%s / %s") % ( self.object._proje_adi(), self.object.get_gundem_tipi_display()) sonuc = _(u"Sonuçlandı") if self.output['object'][u'Kararın Sonuçlandırılması'] == u'True' \ else _(u"Sonuçlanmadı") self.output['object'][u'Kararın Sonuçlandırılması'] = sonuc del self.output['object'][u'Gündem Ekstra Bilgileri']
def get_model_permissions(permission_list=None): from pyoko.model import model_registry from zengine.views.crud import CrudView generic_commands = CrudView().VIEW_METHODS.keys() permissions = permission_list or [] for model in model_registry.get_base_models(): model_name = model.__name__ permissions.append((model_name, model_name, "")) for cmd in generic_commands: if cmd in ['do']: continue permissions.append(("%s.%s" % (model_name, cmd), "Can %s %s" % (cmd, model_name), "")) return permissions
def _get_model_permissions(permission_list=None): from pyoko.model import model_registry from zengine.views.crud import CrudView generic_commands = CrudView().VIEW_METHODS.keys() permissions = permission_list or [] enabled_models = _get_object_menu_models() for model in model_registry.get_base_models(): model_name = model.__name__ permissions.append((model_name, model_name, "")) if model_name not in enabled_models: # no matter if it's available as CRUD or not, # we may need a ListBox for any model permissions.append(("%s.select_list" % model_name, "Listbox for %s" % model_name, "")) continue for cmd in generic_commands: if cmd in ['do']: continue permissions.append(("%s.%s" % (model_name, cmd), "Can %s %s" % (cmd, model_name), "")) return permissions
def __init__(self, current=None): CrudView.__init__(self, current) self.ListForm.add = fields.Button(__(u"Tekliflerimi Göster"), cmd='tekliflerim') self.model_class.Meta.verbose_name_plural = __(u"Teklife Açık Bütçe Kalemi Satın Almaları") self.firma = self.current.user.bap_firma_set[0].bap_firma
def __init__(self, current=None): CrudView.__init__(self, current) self.ListForm.add = None
def __init__(self, current): CrudView.__init__(self, current) if 'personel_id' not in self.current.task_data: self.current.task_data["personel_id"] = self.current.input["id"]
def __init__(self, current): self.ObjectForm = SaglikRaporuForm CrudView.__init__(self, current) if 'personel_id' not in self.current.task_data: self.current.task_data["personel_id"] = self.current.input["id"]
def list(self, custom_form=None): CrudView.list(self) form = JsonForm(title=_(u"Sıkça Sorulan Sorular")) form.ekle = fields.Button(_(u"Ekle"), cmd='add_edit_form') self.form_out(form)
def __init__(self, current): CrudView.__init__(self, current) if self.cmd != 'confirm_deletion' and self.cmd != 'delete' \ and 'object_id' in self.current.task_data: del self.current.task_data['object_id']
def __init__(self, current): CrudView.__init__(self, current) if not self.object.key: self.object = self.model_class.objects.get( self.current.task_data['bap_proje_id'])
def __init__(self, current=None): CrudView.__init__(self, current) self.ListForm.add = None self.model_class.Meta.verbose_name_plural = __( u"Firma Başvuru Değerlendirmeleri")
def save(self): CrudView.save(self) self.object.ekleyen = self.current.user self.object.yayinlanmis_mi = False self.object.blocking_save()
def delete(self): self.object = BAPIsPaketi.objects.get(self.current.task_data['is_paketi_id']) CrudView.delete(self) del self.current.task_data['is_paketi_id']
def __init__(self, current): CrudView.__init__(self, current) if 'object_id' in self.current.task_data and self.cmd == 'add_edit_form' and \ 'object_id' not in self.input: del self.current.task_data['object_id'] self.object = BAPTakvim()
def list(self, custom_form=None): custom_form = TakvimListForm() CrudView.list(self, custom_form)