<input type="date">
class SupplyAdmin(admin.ModelAdmin):
available_fields = ('name', 'field1', 'field2')
hidden_fields = ('field3',)
def get_form(self, request, obj, **kwargs):
if request.user.username == 'example@example.com':
self.fields = self.available_fields + self.hidden_fields
else:
self.fields = self.available_fields
return super(SupplyAdmin, self).get_form(request, obj, **kwargs)
Гуглил, но так ничего и не нашёл
<?php
function getRows($file) {
$handle = fopen($file, 'rb');
if ($handle === false) {
throw new Exception();
}
while (feof($handle) === false) {
yield fgetcsv($handle);
}
fclose($handle);
}
foreach (getRows('data.csv') as $row) {
print_r($row);
}