Search Results

Search found 2 results on 1 pages for 'krastin konstantinov'.

Page 1/1 | 1 

  • Getting "Unable to find a medium containing a live file system" when installing 10.10

    - by Krastin Konstantinov
    I got this error while trying to install ubuntu 10.10 from a bootable USB stick on to Sony Vaio P series laptop. The disk boots into the language and installation type screen. After that it goes through the splash and pulls up this error: BusyBox v1.13.3 (Ubuntu 1:1.13.3-ubuntu11) built in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) Unable to find a medium containing a live file system After getting this error the installation fails to start. I have used the same USB stick on some other laptops and the installation started as usual. Any help will be appreciated. My installation is i386 and my machine is Vaio P VGN-P610. I've tried every possible thing: Bios: [enable boot external] Boot order: [external] [hard drive] [network boot] Tried 2 different USB drives Tried 2 different external CD drives Tried 6 different downloads of both the desktop and netbook remix. All downloads were checked with MD5SUM. Ubuntu Desktop 9.10 installs properly in every version and from every source. Getting reaaaally frustrated.

    Read the article

  • Django: how to cleanup form fields and avoid code duplication

    - by Alexander Konstantinov
    Quite often I need to filter some form data before using it (saving to database etc.) Let's say I want to strip whitespaces and replace repeating whitespaces with a single one in most of the text fields, in many forms. It's not difficult to do this using clean_<fieldname> methods: # Simplified model with two text fields class MyModel(models.Model): title = models.CharField() description = models.CharField() # Model-based form class MyForm(forms.ModelForm): class Meta: model = MyModel def clean_title(self): title = self.cleaned_data['title'] return re.sub(r'\s{2,}', ' ', title.strip()) def clean_description(self): description = self.cleaned_data['description'] return re.sub(r'\s{2,}', ' ', description.strip()) It does exactly what I need, and has a nice side effect which I like: if user enters only whitespaces, the field will be considered empty and therefore invalid (if it is required) and I don't even have to throw a ValidationError. The obvious problem here is code duplication. Even if I'll create some function for that, say my_text_filter, I'll have to call it for every text field in all my forms: from myproject.filters import my_text_filter class MyForm(forms.ModelForm): class Meta: model = MyModel def clean_title(self): return my_text_filter(self.cleaned_data['title']) def clean_description(self): return my_text_filter(self.cleaned_data['description']) The question: is there any standard and simple way in Django (I use version 1.2 if that matters) to do this (like, for example, by adding property validators = {'title': my_text_filter, 'description': my_text_filter} to MyModel), or at least some more or less standard workaround? I've read about form validation and validators in the documentation, but couldn't find what I need there.

    Read the article

1